|
bk commit - mysqldoc tree (1.449): msg#00350db.mysql.devel
Below is the list of changes that have just been committed into a local mysqldoc repository of guilhem. When guilhem does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://www.mysql.com/doc/I/n/Installing_source_tree.html ChangeSet 1.449 03/04/24 23:04:17 guilhem@xxxxxxxxx +1 -0 New variable relay_log_purge Replaced the big @multitable with many subsubsections; the advantage is that I can now make several paragraphs in the long description of CHANGE MASTER TO or SHOW SLAVE STATUS, making it more organized. Changeset entry for 4.1.1 (fixed bug #53 + relay_log_purge) Docs/manual.texi 1.423 03/04/24 23:04:16 guilhem@xxxxxxxxx +144 -85 New variable relay_log_purge Replaced the big @multitable with many subsubsections; the advantage is that I can now make several paragraphs in the long description of CHANGE MASTER TO or SHOW SLAVE STATUS, making it more organized. Changeset entry for 4.1.1 (fixed bug #53 + relay_log_purge) # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: guilhem # Host: gbichot.local # Root: /home/mysql_src/mysqldoc --- 1.422/Docs/manual.texi Thu Apr 24 21:08:52 2003 +++ 1.423/Docs/manual.texi Thu Apr 24 23:04:16 2003 @@ -26078,6 +26078,13 @@ To give @file{relay-log.info} another name and/or to put it in another directory than the data directory. +@item @code{relay-log-purge=0|1} @tab +Available since MySQL 4.1.1. +Disables/enables automatic purging of relay logs as soon as they are +not needed anymore. This is a global variable which can be dynamically +changed with @code{SET GLOBAL RELAY_LOG_PURGE=0|1}. The default value +is 1. + @item @code{relay-log-space-limit=#} @tab To put an upper limit on the total size of all relay logs on the slave. This is useful @@ -26282,45 +26289,66 @@ @cindex replication, commands Replication can be controlled through the SQL interface. Here is the -summary of commands: +summary of commands. Near each command you will find ``(Slave)'', +meaning this command is issued on the slave, or ``Master'', meaning +it is issued on the master. + +@menu +* START SLAVE:: @code{START SLAVE} +* STOP SLAVE:: @code{STOP SLAVE} +* SET SQL_LOG_BIN:: @code{SET SQL_LOG_BIN} +* SET GLOBAL SQL_SLAVE_SKIP_COUNTER:: @code{SET GLOBAL SQL_SLAVE_SKIP_COUNTER} +* RESET MASTER:: @code{RESET MASTER} +* RESET SLAVE:: @code{RESET SLAVE} +* LOAD TABLE FROM MASTER:: @code{LOAD TABLE FROM MASTER} +* LOAD DATA FROM MASTER:: @code{LOAD DATA FROM MASTER} +* CHANGE MASTER TO:: @code{CHANGE MASTER TO} +* MASTER_POS_WAIT:: @code{MASTER_POS_WAIT()} +* SHOW MASTER STATUS:: @code{SHOW MASTER STATUS} +* SHOW SLAVE HOSTS:: @code{SHOW SLAVE HOSTS} +* SHOW SLAVE STATUS:: @code{SHOW SLAVE STATUS} +* SHOW MASTER LOGS:: @code{SHOW MASTER LOGS} +* SHOW BINLOG EVENTS:: @code{SHOW BINLOG EVENTS} +* SHOW NEW MASTER:: @code{SHOW NEW MASTER} +* PURGE MASTER LOGS:: @code{PURGE [MASTER] LOGS} +@end menu -@multitable @columnfractions .45 .55 -@item @strong{Command} @tab @strong{Description} +@node START SLAVE +@subsubsection @code{START SLAVE} (slave) -@item @code{START SLAVE} - @tab Starts the slave threads. +Starts the slave threads. Was called @code{SLAVE START} in MySQL 3.23. As of MySQL 4.0.2, you can add @code{IO_THREAD} or @code{SQL_THREAD} options to the statement to start only the I/O thread or the SQL thread. The I/O thread reads queries from the master server and stores them in the relay log. The SQL thread reads the relay log and executes the queries. -(Slave) -@item @code{STOP SLAVE} - @tab Stops the slave threads. Like @code{SLAVE START}, this statement -may be used with @code{IO_THREAD} and @code{SQL_THREAD} options. (Slave) - -@item @code{SET SQL_LOG_BIN=0} - @tab Disables binary logging for the user's connection +@node STOP SLAVE +@subsubsection @code{STOP SLAVE} (slave) +Stops the slave threads. Was called @code{SLAVE STOP} in MySQL 3.23. +Like @code{SLAVE START}, this statement +may be used with @code{IO_THREAD} and @code{SQL_THREAD} options. + +@node SET SQL_LOG_BIN +@subsubsection @code{SET SQL_LOG_BIN=0|1} (master) +Disables/enables binary logging for the user's connection (@code{SQL_LOG_BIN} is a session variable) if the user has the @code{SUPER} privilege. - Ignored otherwise. (Master) - -@item @code{SET SQL_LOG_BIN=1} - @tab Re-enables binary logging for the user's connexion -if the user has the @code{SUPER} privilege. - Ignored otherwise. (Master) +Ignored otherwise. -@item @code{SET GLOBAL SQL_SLAVE_SKIP_COUNTER=n} - @tab Skip the next @code{n} events from the master. Only valid when +@node SET GLOBAL SQL_SLAVE_SKIP_COUNTER +@subsubsection @code{SET GLOBAL SQL_SLAVE_SKIP_COUNTER=n} (slave) +Skip the next @code{n} events from the master. Only valid when the slave thread is not running, otherwise, gives an error. Useful for -recovering from replication breaks caused by a statement. - -@item @code{RESET MASTER} - @tab Deletes all binary logs listed in the index file, resetting the binlog -index file to be empty. Previously named @code{FLUSH MASTER}. (Master) +recovering from replication stops caused by a statement. -@item @code{RESET SLAVE} - @tab Makes the slave forget its replication position in the master's binlogs, +@node RESET MASTER +@subsubsection @code{RESET MASTER} (master) +Deletes all binary logs listed in the index file, resetting the binlog +index file to be empty. Previously named @code{FLUSH MASTER}. + +@node RESET SLAVE +@subsubsection @code{RESET SLAVE} (slave) +Makes the slave forget its replication position in the master's binlogs, deletes the @code{master.info} and @code{relay-log.info} files, all relay logs, starts a new relay log. Connection information (@code{master-host} et al.) is not cleared in @@ -26329,19 +26357,19 @@ the slave server between @code{RESET SLAVE} and @code{START SLAVE}, then the connection information in memory will be lost and reread from the command-line or @file{my.cnf}. Previously named @code{FLUSH SLAVE}. -(Slave) -@item @code{LOAD TABLE tblname FROM MASTER} - @tab Downloads a copy of the table from master to the slave. Implemented +@node LOAD TABLE FROM MASTER +@subsubsection @code{LOAD TABLE tblname FROM MASTER} (slave) +Downloads a copy of the table from master to the slave. Implemented mainly for debugging of @code{LOAD DATA FROM MASTER}. Requires that the replication user which is used to connect to the master has @code{RELOAD} and @code{SUPER} privileges on the master. Please read the timeout notes in the description of @code{LOAD DATA FROM MASTER} below, they apply here too. -(Slave) -@item @code{LOAD DATA FROM MASTER} - @tab Takes a snapshot of the master and copies +@node LOAD DATA FROM MASTER +@subsubsection @code{LOAD DATA FROM MASTER} (slave) +Takes a snapshot of the master and copies it to the slave. Requires that the replication user which is used to connect to the master has @code{RELOAD} and @code{SUPER} privileges on the master. @@ -26362,8 +26390,9 @@ tables from the @code{mysql} database. This is to make it easy to have different users and privileges on the master and the slave. -@item @code{CHANGE MASTER TO master_def_list} - @tab (Slave) Changes the master parameters (connection information) +@node CHANGE MASTER TO +@subsubsection @code{CHANGE MASTER TO master_def_list} (slave) +Changes the master parameters (connection information) to the values specified in @code{master_def_list}. @code{master_def_list} is a comma-separated list of @code{master_def} where @code{master_def} is one of the following: @code{MASTER_HOST}, @code{MASTER_USER}, @@ -26406,7 +26435,9 @@ @code{CHANGE MASTER TO} deletes all relay logs and starts a new one, unless you specified @code{RELAY_LOG_FILE} or -@code{RELAY_LOG_POS} (in that case relay logs will be kept). +@code{RELAY_LOG_POS} (in that case relay logs will be kept; +since MySQL 4.1.1 the @code{RELAY_LOG_PURGE} global variable +will silently be set to 0). @code{CHANGE MASTER TO} updates @file{master.info} and @file{relay-log.info}. The first example above changes the master and master's binlog @@ -26422,6 +26453,7 @@ logs), supposedly named @file{myhost-bin.*}. First make a backup copy of these binlogs in some safe place, in case you don't exactly follow the procedure below and accidentally have the server purge the binlogs. +If using MySQL 4.1.1 or newer, do @code{SET GLOBAL RELAY_LOG_PURGE=0} for additional safety. Then start the server without @code{log-bin}, with a new (different from before) server id, with @code{relay-log=myhost-bin} (to make the server believe that these regular binlogs are relay @@ -26435,8 +26467,9 @@ Then the server will read and execute its own binlogs, thus achieving crash recovery. -Once the recovery is finished, run @code{STOP SLAVE; RESET SLAVE;}, shutdown the -server and restart it with its original options. +Once the recovery is finished, run @code{STOP SLAVE}, shutdown the +server, delete @code{master.info} and @code{relay-log.info}, +and restart the server with its original options. For the moment, specifying @code{MASTER_HOST} (even with a dummy value) is compulsory to make the server think he is a slave, and giving the server a new, different from before, server id is also compulsory otherwise the @@ -26444,17 +26477,23 @@ replication setup and skip the events, which is unwanted. In the future we plan to add options to get rid of these small constraints. -@item @code{MASTER_POS_WAIT()} @tab +@node MASTER_POS_WAIT +@subsubsection @code{MASTER_POS_WAIT()} (slave) This is not a command but a function, used to ensure that the slave has reached (read and executed up to) a given position in the master's binlog; @pxref{Miscellaneous functions} for a full description. -@item @code{SHOW MASTER STATUS} @tab Provides status information on the binlog of the master. (Master) - -@item @code{SHOW SLAVE HOSTS} @tab Gives a -listing of slaves currently registered with the master. (Master) - -@item @code{SHOW SLAVE STATUS} @tab Provides status information on +@node SHOW MASTER STATUS +@subsubsection @code{SHOW MASTER STATUS} (master) +Provides status information on the binlog of the master. + +@node SHOW SLAVE HOSTS +@subsubsection @code{SHOW SLAVE HOSTS} (master) +Gives a listing of slaves currently registered with the master. + +@node SHOW SLAVE STATUS +@subsubsection @code{SHOW SLAVE STATUS} (slave) +Provides status information on essential parameters of the slave threads (Slave). If you type it in the @code{mysql} client, you can put a @code{\G} instead of a semi-colon at the end, to get a vertical, more readable layout: @@ -26483,34 +26522,38 @@ 1 row in set (0.00 sec) @end example -@code{Master_Host} is the -current master host. -@code{Master_User} is the -current user used to connect to the master. -@code{Master_Port} is the -current master port. -@code{Connect_Retry} is the -current value of @code{master-connect-retry}. -@code{Master_Log_File} is +@itemize +@item @code{Master_Host} +the current master host. +@item @code{Master_User} +the current user used to connect to the master. +@item @code{Master_Port} +the current master port. +@item @code{Connect_Retry} +the current value of @code{master-connect-retry}. +@item @code{Master_Log_File} the master's binlog in which the I/O thread is currently reading. -@code{Read_Master_Log_Pos} is the -position which the I/O thread has read up to in this master's binlog. -@code{Relay_Log_File} is the -relay log which the SQL thread is currently reading and executing. -@code{Relay_Log_Pos} is the -position which the SQL thread has read and executed up to in this relay log. -@code{Relay_Master_Log_File} is the master's binlog which contains the +@item @code{Read_Master_Log_Pos} +the position which the I/O thread has read up to in this master's binlog. +@item @code{Relay_Log_File} +the relay log which the SQL thread is currently reading and executing. +@item @code{Relay_Log_Pos} +the position which the SQL thread has read and executed up to in this relay log. +@item @code{Relay_Master_Log_File} +the master's binlog which contains the last event executed by the SQL thread. -@code{Slave_IO_Running} tells whether the I/O thread is started or not. -@code{Slave_SQL_Running} tells whether the SQL thread is started or not. -@code{Replicate_do_db} / @code{Replicate_ignore_db} are the -lists of the databases which have been specified with option +@item @code{Slave_IO_Running} +tells whether the I/O thread is started or not. +@item @code{Slave_SQL_Running} +tells whether the SQL thread is started or not. +@item @code{Replicate_do_db} / @code{Replicate_ignore_db} +the lists of the databases which have been specified with option @code{replicate-do-db} / @code{replicate-ignore-db}; starting from version 4.1, options @code{replicate_*_table} are also displayed in four more columns. -@code{Last_errno} is +@item @code{Last_errno} the error number returned by the lastly executed query (should be 0). -@code{Last_error} is +@item @code{Last_error} the error message returned by the lastly executed query (should be empty); if not empty, you will find this message in the slave's error log too. For example: @@ -26521,31 +26564,38 @@ Here the table 'z' existed on the master and was dropped there, but it did not exist on the slave (the user had forgotten to copy it to the slave when setting the slave up), so @code{DROP TABLE} failed on the slave. -@code{Skip_counter} is the -last used value for @code{SQL_SLAVE_SKIP_COUNTER}. -@code{Exec_master_log_pos} is the -position in the master's binlog (@code{Relay_Master_Log_File}) +@item @code{Skip_counter} +the last used value for @code{SQL_SLAVE_SKIP_COUNTER}. +@item @code{Exec_master_log_pos} +the position in the master's binlog (@code{Relay_Master_Log_File}) of the last event executed by the SQL thread. ((@code{Relay_Master_Log_File},@code{Exec_master_log_pos}) in the master's binlog corresponds to (@code{Relay_Log_File},@code{Relay_Log_Pos}) in the relay log). -@code{Relay_log_space} is the -total size of all existing relay logs. +@item @code{Relay_log_space} +the total size of all existing relay logs. +@end itemize -@item @code{SHOW MASTER LOGS} @tab Lists the binary logs on the master. You should use this +@node SHOW MASTER LOGS +@subsubsection @code{SHOW MASTER LOGS} (master) +Lists the binary logs on the master. You should use this command prior to @code{PURGE [MASTER] LOGS} to find out how far you -should go. (Master) +should go. + +@node SHOW BINLOG EVENTS +@subsubsection @code{SHOW BINLOG EVENTS} (master) +@code{SHOW BINLOG EVENTS [ IN 'logname' ] [ FROM pos ] [ LIMIT [offset,] rows ] } -@item @code{SHOW BINLOG EVENTS [ IN 'logname' ] [ FROM pos ] - [ LIMIT [offset,] rows ] } @tab Shows the events in the binary log. If you do not specify @code{'logname'}, the first binary log will be displayed. -(Master) -@item @code{SHOW NEW MASTER FOR SLAVE WITH MASTER_LOG_FILE='logfile' AND - MASTER_LOG_POS=pos AND -MASTER_LOG_SEQ=log_seq AND MASTER_SERVER_ID=server_id} @tab +@node SHOW NEW MASTER +@subsubsection @code{SHOW NEW MASTER FOR SLAVE} (slave) +@code{SHOW NEW MASTER FOR SLAVE +WITH MASTER_LOG_FILE='logfile' AND MASTER_LOG_POS=pos AND +MASTER_LOG_SEQ=log_seq AND MASTER_SERVER_ID=server_id} + This command is used when a slave of a possibly dead/unavailable master needs to be switched to replicate off another slave that has been replicating the same master. The command will return recalculated @@ -26556,8 +26606,9 @@ replication code. We may later change the syntax if we find a more intuitive way to describe this operation. -@item @code{PURGE [MASTER] LOGS TO 'logname' ; PURGE [MASTER] LOGS BEFORE 'date'} - @tab +@node PURGE MASTER LOGS +@subsubsection @code{PURGE [MASTER] LOGS} (master) +@code{PURGE [MASTER] LOGS TO 'logname' ; PURGE [MASTER] LOGS BEFORE 'date'} The @code{BEFORE} variant is available in MySQL 4.1; its date argument can be in format 'YYYY-MM-DD HH:MI:SS'. @@ -26587,8 +26638,6 @@ last log on the list), backup all the logs you are about to delete (optional) and purge up to the target log. -@end multitable - @node Replication FAQ, Replication Problems, Replication SQL, Replication @subsection Replication FAQ @@ -57448,10 +57497,20 @@ Functionality added or changed: @itemize +@item +New global variable @code{RELAY_LOG_PURGE} to enable/disable automatic +relay log purging. @end itemize Bugs fixed: @itemize +@item +Fixed a rare replication bug when a transaction spanned on two or more +relay logs, and the slave was stopped while he was executing the part +of the transaction which was in the second or further relay log. Then +replication would resume at the beginning of the second or further +relay log, which was wrong (it should resume at @code{BEGIN}, in the +first relay log). Bug #53. @item Fixed double freed memory @item -- MySQL Internals Mailing List For list archives: http://lists.mysql.com/internals To unsubscribe: http://lists.mysql.com/internals?unsub=gcdmd-internals@xxxxxxxxxxx |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | bk commit into 4.0 tree (1.1473): 00350, heikki |
|---|---|
| Next by Date: | bk commit into 4.0 tree (1.1474): 00350, greg |
| Previous by Thread: | bk commit into 4.0 tree (1.1473)i: 00350, heikki |
| Next by Thread: | bk commit into 4.0 tree (1.1474): 00350, greg |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |