Bug #66626 | user defined variables replicated to same server and stop slave sql_thread hangs | ||
---|---|---|---|
Submitted: | 30 Aug 2012 20:02 | Modified: | 4 Feb 2013 5:08 |
Reporter: | Dan Ragle | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S2 (Serious) |
Version: | 5.1.61-log | OS: | Linux (RHEL 6.3) |
Assigned to: | CPU Architecture: | Any | |
Tags: | user-defined variables wrong server-id stop slave sql_thread hangs |
[30 Aug 2012 20:02]
Dan Ragle
[31 Aug 2012 19:54]
Sveta Smirnova
Thank you for the report. I can not repeat described behavior with current version 5.1.65. Please try this version and inform us if this problem still repeatable in your environment.
[1 Sep 2012 19:25]
Dan Ragle
Hi, thanks for the reply. I updated my test servers to 5.1.65 from the mysql.com site, and the original problem appears to have gone away. HOWEVER, in its place I noticed this: After step 4 in the above test, the RELAY log on "B" has this: # at 488 #120901 14:59:56 server id 1 end_log_pos 636 User_var SET @`mine`:=_latin1 0x7468697264 COLLATE `latin1_swedish_ci`/*!*/; # at 530 #120901 14:59:56 server id 1 end_log_pos 759 Query thread_id=3 exec_time=0 error_code=0 SET TIMESTAMP=1346525996/*!*/; insert into TESTTABLE (testthis,testthat) values (3,@mine) /*!*/; but the BINARY log on "B" has this: # at 616 #120901 14:59:07 server id 2 end_log_pos 741 Query thread_id=3 exec_time=0 error_code=0 SET TIMESTAMP=1346525947/*!*/; insert into TESTTABLE (testthis,testthat) values (1,'first') /*!*/; # at 741 #120901 14:59:14 server id 2 end_log_pos 867 Query thread_id=3 exec_time=0 error_code=0 SET TIMESTAMP=1346525954/*!*/; insert into TESTTABLE (testthis,testthat) values (2,'second') /*!*/; # at 867 #120901 14:59:56 server id 1 end_log_pos 990 Query thread_id=3 exec_time=0 error_code=0 SET TIMESTAMP=1346525996/*!*/; insert into TESTTABLE (testthis,testthat) values (3,@mine) /*!*/; I.E., notice that now the setting of @mine doesn't actually get into the binary log of "B" at all. Thus the original problem is avoided, since the stray set @mine statement never makes it back to the "A" server. But wouldn't that cause a problem for any other slaves of "B" (e.g., a "C" server that is a slave of "B")? In my test environment I don't have a third server that I can setup as a slave of "B", but that is exactly what we do in our production environment and I'd be concerned that "C" would not replicate properly in that scenario.
[3 Sep 2012 18:52]
Sveta Smirnova
Thank you for the feedback. Not, slave C would not be affected: it replicates those changes which are in binary log of B. Relay logs are for B only, they are not used by C. Closing as "Can't repeat" since bug is not repeatable anymore.
[3 Sep 2012 22:45]
Dan Ragle
I'm not following that. As you stated, a "C" slave server would only replicate those changes which are in binary log of B. And since there is no statement in the "B" binary log to set the value for @mine, how could the third statement (which relied on @mine) possibly replicate properly? I.E., again, here are the three statements, in order, that were in the binary log of "B" following the above test with 5.1.65: # at 616 #120901 14:59:07 server id 2 end_log_pos 741 Query thread_id=3 exec_time=0 error_code=0 SET TIMESTAMP=1346525947/*!*/; insert into TESTTABLE (testthis,testthat) values (1,'first') /*!*/; # at 741 #120901 14:59:14 server id 2 end_log_pos 867 Query thread_id=3 exec_time=0 error_code=0 SET TIMESTAMP=1346525954/*!*/; insert into TESTTABLE (testthis,testthat) values (2,'second') /*!*/; # at 867 #120901 14:59:56 server id 1 end_log_pos 990 Query thread_id=3 exec_time=0 error_code=0 SET TIMESTAMP=1346525996/*!*/; insert into TESTTABLE (testthis,testthat) values (3,@mine) /*!*/; Cheers!
[4 Sep 2012 17:47]
Sveta Smirnova
Thank you for the feedback. Sorry, I forgot this is statement format. I re-tested this with 5.1.65 again and now I can repeat original problem, but not issue with lack of variable in the binary log. So verifying original problem.
[28 Jan 2013 12:04]
Sujatha Sivakumar
This issue was fixed as part BUG#13596613. Fix is available from 5.1.66 and 5.5.28. (Issue does not occur in 5.6.)