[MDEV-4322] Broken XID counting during binlog rotation Created: 2013-03-24 Updated: 2024-01-23 Resolved: 2013-03-25 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.1 |
| Fix Version/s: | 10.0.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Pavel Ivanov | Assignee: | Kristian Nielsen |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | replication | ||
| Description |
|
It looks like rotation of binlogs involves some broken logic involving . After binlog rotation MYSQL_BIN_LOG::do_checkpoint_request() is called. It calls ha_commit_checkpoint_request(), and from there for each engine that has commit_checkpoint_request function binlog_checkpoint_callback() is called. There mysql_bin_log.mark_xids_active() is called and corresponding mark_xid_done() is not called from anywhere. I don't understand why this problem is not exposed anywhere in the test suite but I was able to hit it like this: cmake . -DCMAKE_BUILD_TYPE=Debug After that I get "void MYSQL_BIN_LOG::cleanup(): Assertion `b->xid_count == 0' failed" during shutdown after the test. |
| Comments |
| Comment by Elena Stepanova [ 2013-03-24 ] |
|
perl ./mtr sys_vars.rpl_max_binlog_size_func - #7 0x00007fc5c1010192 in _GI__assert_fail (assertion=0xe4eaa4 "b->xid_count == 0", file=0xe4dd48 "/data/bzr/10.0/sql/log.cc", line=2979, function=0xe51d90 "void MYSQL_BIN_LOG::cleanup()") at assert.c:103 |
| Comment by Kristian Nielsen [ 2013-03-24 ] |
|
Thanks for catching this! > There mysql_bin_log.mark_xids_active() is called and corresponding It is called from binlog_background_thread(). This happens asynchroneously, in I suspect the problem here is that we need to wait for the binlog background --source include/wait_for_binlog_checkpoint.inc I'll take a closer look next week and find out what the real solution should |
| Comment by Kristian Nielsen [ 2013-03-25 ] |
|
Fix pushed to 10.0-base (will be later merged to 10.0). |
| Comment by Kristian Nielsen [ 2013-03-25 ] |
|
Here is the patch for the bug, including test case: http://lists.askmonty.org/pipermail/commits/2013-March/004483.html |