Replication Features and Issues
1502
Replication of
LIMIT
clauses in
DELETE
,
UPDATE
, and
INSERT ... SELECT
statements is not
guaranteed, since the order of the rows affected is not defined. Such statements can be replicated
correctly only if they also contain an
ORDER BY
clause.
16.4.1.10. Replication and
LOAD
Operations
Using
LOAD TABLE FROM MASTER
where the master is running MySQL 4.1 and the slave is running
MySQL 5.0 may corrupt the table data, and is not supported. (Bug #16261)
The
LOAD DATA INFILE
statement
CONCURRENT
option is not replicated; that is,
LOAD DATA
CONCURRENT INFILE
is replicated as
LOAD DATA INFILE
, and
LOAD DATA CONCURRENT LOCAL
INFILE
is replicated as
LOAD DATA LOCAL INFILE
. (Bug #34628)
The following applies only if either the master or the slave is running MySQL 5.0.3 or older: If on the
master a
LOAD DATA INFILE
is interrupted (integrity constraint violation, killed connection, and so
on), the slave skips the
LOAD DATA INFILE
entirely. This means that if this command permanently
inserted or updated table records before being interrupted, these modifications are not replicated to the
slave.
16.4.1.11. Replication and the Slow Query Log
Replication slaves do not write replicated queries to the slow query log, even if the same queries were
written to the slow query log on the master. This is a known issue. (Bug #23300)
16.4.1.12. Replication and
REPAIR TABLE
When used on a corrupted or otherwise damaged table, it is possible for the
REPAIR TABLE
statement
to delete rows that cannot be recovered. However, any such modifications of table data performed
by this statement are not replicated, which can cause master and slave to lose synchronization.
For this reason, in the event that a table on the master becomes damaged and you use
REPAIR
TABLE
to repair it, you should first stop replication (if it is still running) before using
REPAIR TABLE
,
then afterward compare the master's and slave's copies of the table and be prepared to correct any
discrepancies manually, before restarting replication.
16.4.1.13. Replication and Master or Slave Shutdowns
It is safe to shut down a master server and restart it later. When a slave loses its connection to the
master, the slave tries to reconnect immediately and retries periodically if that fails. The default is
to retry every 60 seconds. This may be changed with the
CHANGE MASTER TO
statement or
--
master-connect-retry
[1453]
option. A slave also is able to deal with network connectivity
outages. However, the slave notices the network outage only after receiving no data from the master
for
slave_net_timeout
[1466]
seconds. If your outages are short, you may want to decrease
slave_net_timeout
[1466]
. See
Section 5.1.4, “Server System Variables”
.
An unclean shutdown (for example, a crash) on the master side can result in the master binary log
having a final position less than the most recent position read by the slave, due to the master binary log
file not being flushed. This can cause the slave not to be able to replicate when the master comes back
up. Setting
sync_binlog=1
[1472]
in the master
my.cnf
file helps to minimize this problem because
it causes the master to flush its binary log more frequently.
Unclean master shutdowns may cause inconsistencies between the content of tables and the binary
log. This can be avoided by using
InnoDB
tables and the
--innodb-safe-binlog
[409]
option on
the master. See
Section 5.2.3, “The Binary Log”
.
Note
--innodb-safe-binlog
[409]
is unneeded as of MySQL 5.0.3, having been
made obsolete by the introduction of XA transaction support.
Shutting down a slave cleanly is safe because it keeps track of where it left off. However, be careful
that the slave does not have temporary tables open; see
Section 16.4.1.15, “Replication and
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...