Mysql:Changes in MySQL 5.6.0 (Not released, Milestone 4):Global UUID
Changes in MySQL 5.6.0 (Not released, Milestone 4)
-
Replication: Globally unique IDs for MySQL servers were implemented. A UUID is now obtained automatically when the MySQL server starts. The server first checks for a UUID written in the
auto.cnffile (in the server's data directory), and uses this UUID if found. Otherwise, the server generates a new UUID and saves it to this file (and creates the file if it does not already exist). This UUID is available as theserver_uuidsystem variable.MySQL replication masters and slaves know each other's UUIDs. The value of a slave's UUID can be read in the output of
SHOW SLAVE HOSTS. After a slave is started usingSTART SLAVE, the value of the master's UUID is available on the slave in the output ofSHOW SLAVE STATUS. (Bug #33815, Bug #11747723)References: See also: Bug #16927, Bug #11745543.
-
Partitioning: It is now possible to exchange a partition of a partitioned table or a subpartition of a subpartitioned table with a nonpartitioned table that otherwise has the same structure using the
ALTER TABLE ... EXCHANGE PARTITIONstatement. This can be used, for example, for importing and exporting partitions.For more information and examples, see Exchanging Partitions and Subpartitions with Tables.
-
Replication: MySQL now supports delayed replication such that a slave server deliberately lags behind the master by at least a specified amount of time. The default delay is 0 seconds. Use the new
MASTER_DELAYoption forCHANGE MASTER TOto set the delay toNseconds:CHANGE MASTER TO MASTER_DELAY =
N;An event received from the master is not executed until at least
Nseconds later than its execution on the master.START SLAVEandSTOP SLAVEtake effect immediately and ignore any delay.RESET SLAVEresets the delay to 0.SHOW SLAVE STATUShas three new fields that provide information about the delay:-
SQL_Delay: The number of seconds that the slave must lag the master. -
SQL_Remaining_Delay: WhenSlave_SQL_Running_StateisWaiting until MASTER_DELAY seconds after master executed event, this field contains the number of seconds left of the delay. At other times, this field isNULL. -
Slave_SQL_Running_State: The state of the SQL thread (analogous toSlave_IO_State). The value is identical to theStatevalue of the SQL thread as displayed bySHOW PROCESSLIST.
When the slave SQL thread is waiting for the delay to elapse before executing an event,
SHOW PROCESSLISTdisplays itsStatevalue asWaiting until MASTER_DELAY seconds after master executed event.The
relay-log.infofile now contains the delay value, so the file format has changed. See Slave Status Logs. In particular, the first line of the file now indicates how many lines are in the file. If you downgrade a slave server to a version older than MySQL 5.6, the older server will not read the file correctly. To address this, modify the file in a text editor to delete the initial line containing the number of lines.The introduction of delayed replication entails these restrictions:
-
Previously the
BINLOGstatement could execute all types of events. Now it can execute only format description events and row events. -
The output from mysqlbinlog --base64-output=ALWAYS cannot be parsed.
ALWAYSbecomes an invalid value for this option in 5.6.1.
For additional information, see Delayed Replication. (Bug #28760, Bug #11746794)
-
浙公网安备 33010602011771号