Monday, November 09, 2009

MYSQL Replication - Features and Issue

Please make sure read Replication Features and Issues before do replication

Few problem i found / concern i raise when I make replication
1 UUID in master different from slave and it do not pop any error message.

This confirm by refer to Replication and System Functions

work around solution example:
SET @my_uuid = UUID();
INSERT INTO t VALUES(@my_uuid);

quote : The USER(), CURRENT_USER(), UUID(), VERSION(), and LOAD_FILE() functions are replicated without change and thus do not work reliably on the slave.

2. Will now()function replicate correctly from master to slave? or it will generate a new date when insert data into slave?

Quote:
For NOW(), the binary log includes the timestamp. This means that the value as returned by the call to this function on the master is replicated to the slave.

Need take note this statement as well
Quote:
This can lead to a possibly unexpected result when replicating between MySQL servers in different time zones. For example, suppose that the master is located in New York, the slave is located in Stockholm, and both servers are using local time.

more refer to this link

This statement make my attention :
1. Replication of LIMIT clauses in DELETE, UPDATE, and INSERT ... SELECT statements are 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.

2. Replication During a Master Crash
Setting sync_binlog=1 in the master my.cnf to prevent slave not to be able to replicate when the master comes back up from crash
more detail read here

3. query with nondeterministic
It is possible for the data on the master and slave to become different if a statement is designed in such a way that the data modification is nondeterministic
Examples of nondeterministic statements include DELETE or UPDATE statements that use LIMIT with no ORDER BY clause
Reference : Replication and the Query Optimizer

No comments: