[MDEV-6810] Slave fails when switched from STATEMENT to MIXED and receives ROW event Created: 2014-09-30 Updated: 2015-01-28 Resolved: 2014-10-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Documentation |
| Affects Version/s: | 10.0.11 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Arjen Lentz | Assignee: | Ian Gilfillan |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | documentation | ||
| Environment: |
any |
||
| Description |
|
The following is probably an edge case, but it's still a bug. Tracking it in the code may yield a key for other latent problems. Servers started with binlog_format=STATEMENT. Later, we see this error. 140930 8:51:33 [ERROR] Slave SQL: Error executing row event: 'Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT.', Gtid 0-9-360301963, Int That of course shouldn't happen, as the binlog format has been changed. Conclusion: some variable in running server didn't update to MIXED. |
| Comments |
| Comment by Elena Stepanova [ 2014-10-01 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Arjen, From your description, it looks like you didn't restart replication (didn't issue STOP SLAVE/START SLAVE) after changing the binlog_format. If so, what you observe is totally expected. Binlog format obeys the standard global/session variable behavior, changing it globally only affects new connections, not the existing ones. Your slave threads are already running with the statement format, and are not supposed to pick up the change. For the reference: http://dev.mysql.com/doc/refman/5.5/en/using-system-variables.html ("If you change a global system variable..."). Please comment if you disagree. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Arjen Lentz [ 2014-10-01 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Disagree | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2014-10-01 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Please repeat the exercise and attach the output, similar to the one below. As you can see, it works for me just as expected, and as it has worked for quite a while (the scenario is used in tests sometimes). Or, maybe I misunderstood the use case, in this case please point at the essential difference.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Arjen Lentz [ 2014-10-01 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Enable multi-threaded slave? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2014-10-01 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you, it does make the difference. When the slave is running wih parallel threads (even when slave_parallel_threads=1), these threads don't exit on a replication failure or on STOP SLAVE, so they can't pick up the modified binlog_format. One possible workaround is to run set global slave_parallel_threads=0, which will make those threads exit immediately. After that you can set it back to the previous value if needed, new threads will be created and they will use the new global value of binlog_format. But I'll pass it to knielsen to confirm that it works as designed, and that it's the best possible workaround. Probably, it's also worth documenting somewhere. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kristian Nielsen [ 2014-10-01 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Yes, Elena is correct. Changing a GLOBAL variable does not affect the value of the corresponding And with parallel replication, the worker threads keep running until (There is a feature request to have all worker threads be destroyed when the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2014-10-01 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Ian, Could you please add a note about the specifics described above to the documentation, wherever you think it fits best (unless it's already there)? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Arjen Lentz [ 2014-10-02 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Excellent, glad we got it repeatable, and good came of it! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ian Gilfillan [ 2014-10-02 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This has now been documented at https://mariadb.com/kb/en/mariadb/documentation/log-files/binary-log/binary-log-formats/ with a warning about changing the value at https://mariadb.com/kb/en/mariadb/documentation/replication-cluster-multi-master/replication/replication-and-binary-log-server-system-variables/#binlog_format Will close, as there's already a feature request for destroying the worker threads. |