Bug #70923 | Replication failure on multi-statement INSERT DELAYED queries | ||
---|---|---|---|
Submitted: | 15 Nov 2013 16:59 | Modified: | 18 Nov 2013 19:03 |
Reporter: | Ovais Tariq | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S2 (Serious) |
Version: | 5.5.34, 5.6.16 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | binlog, insert delayed, replication |
[15 Nov 2013 16:59]
Ovais Tariq
[15 Nov 2013 17:04]
Ovais Tariq
-- Master MySQL configuration: [mysql] prompt='master [\h] {\u} (\d) > ' # [client] user = msandbox password = msandbox port = 23389 socket = /tmp/mysql_sandbox23389.sock [mysqld] user = root port = 23389 socket = /tmp/mysql_sandbox23389.sock basedir = /work/binaries/mysql-server/5.5.34 datadir = /work/sandboxes/rsandbox_5_5_34/master/data tmpdir = /work/sandboxes/rsandbox_5_5_34/master/tmp pid-file = /work/sandboxes/rsandbox_5_5_34/master/data/mysql_sandbox23389.pid #log-slow-queries = /work/sandboxes/rsandbox_5_5_34/master/data/msandbox-slow.log #log = /work/sandboxes/rsandbox_5_5_34/master/data/msandbox.log # # additional options passed through 'my_clause' # log-bin=mysql-bin server-id=1 log-error=msandbox.err -- Slave MySQL configuration: [mysql] prompt='slave1 [\h] {\u} (\d) > ' # [client] user = msandbox password = msandbox port = 23390 socket = /tmp/mysql_sandbox23390.sock [mysqld] user = root port = 23390 socket = /tmp/mysql_sandbox23390.sock basedir = /work/binaries/mysql-server/5.5.34 datadir = /work/sandboxes/rsandbox_5_5_34/node1/data tmpdir = /work/sandboxes/rsandbox_5_5_34/node1/tmp pid-file = /work/sandboxes/rsandbox_5_5_34/node1/data/mysql_sandbox23390.pid #log-slow-queries = /work/sandboxes/rsandbox_5_5_34/node1/data/msandbox-slow.log #log = /work/sandboxes/rsandbox_5_5_34/node1/data/msandbox.log # # additional options passed through 'my_clause' # server-id=101 report-host=SBslave1 report-port=23390 log-bin=mysql-bin log-error=msandbox.err
[15 Nov 2013 17:06]
Ovais Tariq
Binlog generated on master: # at 2081 #131115 17:53:56 server id 1 end_log_pos 2387 Query thread_id=3 exec_time=0 error_code=0 use test/*!*/; SET TIMESTAMP=1384534436/*!*/; CREATE TABLE `log_messages` ( `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `message` text NOT NULL, `url` text NOT NULL, `hash` char(32) NOT NULL DEFAULT '' ) ENGINE=MyISAM DEFAULT CHARSET=utf8 /*!*/; # at 2387 #131115 17:55:13 server id 1 end_log_pos 2463 Query thread_id=4 exec_time=0 error_code=0 SET TIMESTAMP=1384534513/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; SET @@session.time_zone='SYSTEM'/*!*/; BEGIN /*!*/; # at 2463 #131115 17:55:13 server id 1 end_log_pos 2848 Query thread_id=4 exec_time=0 error_code=0 SET TIMESTAMP=1384534513/*!*/; INSERT INTO test.log_messages (time_stamp, message, url, hash) VALUES(CURRENT_TIMESTAMP, 'test_msg_1', 'test_url_1', '0bee89b07a248e27c83fc3d5951213c1');INSERT DELAYED INTO test.log_messages (time_stamp, message, url, hash) VALUES(CURRENT_TIMESTAMP, 'test_msg_2', 'test_url_2', 'b6273b589df2dfdbd8fe35b1011e3183') /*!*/; # at 2848 #131115 17:55:13 server id 1 end_log_pos 2925 Query thread_id=4 exec_time=0 error_code=0 SET TIMESTAMP=1384534513/*!*/; COMMIT /*!*/; # at 2925 #131115 17:55:13 server id 1 end_log_pos 3001 Query thread_id=4 exec_time=0 error_code=0 SET TIMESTAMP=1384534513/*!*/; BEGIN /*!*/; # at 3001 #131115 17:55:13 server id 1 end_log_pos 3225 Query thread_id=4 exec_time=0 error_code=0 SET TIMESTAMP=1384534513/*!*/; INSERT INTO test.log_messages (time_stamp, message, url, hash) VALUES(CURRENT_TIMESTAMP, 'test_msg_2', 'test_url_2', 'b6273b589df2dfdbd8fe35b1011e3183') /*!*/; # at 3225 #131115 17:55:13 server id 1 end_log_pos 3302 Query thread_id=4 exec_time=0 error_code=0 SET TIMESTAMP=1384534513/*!*/; COMMIT /*!*/; # at 3302 #131115 17:55:34 server id 1 end_log_pos 3345 Rotate to mysql-bin.000002 pos: 4 DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
[15 Nov 2013 17:08]
Ovais Tariq
Relevant relay log on the slave: # at 2227 #131115 17:53:56 server id 1 end_log_pos 2387 Query thread_id=3 exec_time=0 error_code=0 use test/*!*/; SET TIMESTAMP=1384534436/*!*/; CREATE TABLE `log_messages` ( `time_stamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `message` text NOT NULL, `url` text NOT NULL, `hash` char(32) NOT NULL DEFAULT '' ) ENGINE=MyISAM DEFAULT CHARSET=utf8 /*!*/; # at 2533 #131115 17:55:13 server id 1 end_log_pos 2463 Query thread_id=4 exec_time=0 error_code=0 SET TIMESTAMP=1384534513/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; SET @@session.time_zone='SYSTEM'/*!*/; BEGIN /*!*/; # at 2609 #131115 17:55:13 server id 1 end_log_pos 2848 Query thread_id=4 exec_time=0 error_code=0 SET TIMESTAMP=1384534513/*!*/; INSERT INTO test.log_messages (time_stamp, message, url, hash) VALUES(CURRENT_TIMESTAMP, 'test_msg_1', 'test_url_1', '0bee89b07a248e27c83fc3d5951213c1');INSERT DELAYED INTO test.log_messages (time_stamp, message, url, hash) VALUES(CURRENT_TIMESTAMP, 'test_msg_2', 'test_url_2', 'b6273b589df2dfdbd8fe35b1011e3183') /*!*/; # at 2994 #131115 17:55:13 server id 1 end_log_pos 2925 Query thread_id=4 exec_time=0 error_code=0 SET TIMESTAMP=1384534513/*!*/; COMMIT /*!*/; # at 3071 #131115 17:55:13 server id 1 end_log_pos 3001 Query thread_id=4 exec_time=0 error_code=0 SET TIMESTAMP=1384534513/*!*/; BEGIN /*!*/; # at 3147 #131115 17:55:13 server id 1 end_log_pos 3225 Query thread_id=4 exec_time=0 error_code=0 SET TIMESTAMP=1384534513/*!*/; INSERT INTO test.log_messages (time_stamp, message, url, hash) VALUES(CURRENT_TIMESTAMP, 'test_msg_2', 'test_url_2', 'b6273b589df2dfdbd8fe35b1011e3183') /*!*/; # at 3371 #131115 17:55:13 server id 1 end_log_pos 3302 Query thread_id=4 exec_time=0 error_code=0 SET TIMESTAMP=1384534513/*!*/; COMMIT /*!*/; # at 3448 #131115 17:51:49 server id 101 end_log_pos 3510 Rotate to mysql_sandbox23390-relay-bin.000003 pos: 4 DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
[15 Nov 2013 19:00]
Sveta Smirnova
Thank you for the report. Verified as described. Bug is only repeatable if PHP script is used, but I still think this is server bug, because general query log does not show anything wrong was issued by PHP: | 2013-11-15 21:46:08 | root[root] @ localhost [127.0.0.1] | 11 | 1 | Query | INSERT DELAYED INTO test.log_messages (time_stamp, message, url, hash) VALUES(CURRENT_TIMESTAMP, 'test_msg_1', 'test_url_1', '0bee89b07a248e27c83fc3d5951213c1'); | | 2013-11-15 21:46:08 | root[root] @ localhost [127.0.0.1] | 11 | 1 | Query | INSERT DELAYED INTO test.log_messages (time_stamp, message, url, hash) VALUES(CURRENT_TIMESTAMP, 'test_msg_2', 'test_url_2', 'b6273b589df2dfdbd8fe35b1011e3183') |
[15 Nov 2013 19:06]
Ovais Tariq
Hi Sveta, Thank you for the fast verification. Could you tell me how else did you test the queries with, apart from using PHP?
[15 Nov 2013 19:25]
Sveta Smirnova
A tried to repeat this behavior using MySQL command-line client.
[18 Nov 2013 19:03]
Ovais Tariq
PHP probably sends the queries differently to the server. But still this appears to be a MySQL server bug rather then a client library issue.