Skip to content

MDEV-35397: Fix semisync assertion on slave disconnect/reconnect race - #5578

Open
nadaelsayed11 wants to merge 1 commit into
MariaDB:10.11from
nadaelsayed11:MDEV-35397-remove-slave-reconnect-race-10.11
Open

MDEV-35397: Fix semisync assertion on slave disconnect/reconnect race#5578
nadaelsayed11 wants to merge 1 commit into
MariaDB:10.11from
nadaelsayed11:MDEV-35397-remove-slave-reconnect-race-10.11

Conversation

@nadaelsayed11

Copy link
Copy Markdown
Contributor

Repl_semi_sync_master::remove_slave() clears the entire active-transaction list when the last semisync client disconnects (with rpl_semi_sync_master_wait_no_slave=0), but unlike switch_off() it never bumped rpl_semi_sync_master_off_times. A transaction parked in commit_trx()'s wait loop tolerates a lone disconnect fine, since its own 'no clients left' guard matches remove_slave()'s. But if a slave reconnects before the waiter re-checks, that guard no longer fires, and the waiter finds its entry missing with off_times unchanged, tripping the DBUG_ASSERT that assumes only switch_off() can cause a missing entry. Bump rpl_semi_sync_master_off_times in remove_slave() too, mirroring switch_off(), so the invariant holds and the waiter takes the intended 'skip the wait' exit instead of asserting.

Repl_semi_sync_master::remove_slave() clears the entire active-transaction list when the last semisync client disconnects (with rpl_semi_sync_master_wait_no_slave=0), but unlike switch_off() it never bumped rpl_semi_sync_master_off_times. A transaction parked in commit_trx()'s wait loop tolerates a lone disconnect fine, since its own 'no clients left' guard matches remove_slave()'s. But if a slave reconnects before the waiter re-checks, that guard no longer fires, and the waiter finds its entry missing with off_times unchanged, tripping the DBUG_ASSERT that assumes only switch_off() can cause a missing entry.
Bump rpl_semi_sync_master_off_times in remove_slave() too, mirroring switch_off(), so the invariant holds and the waiter takes the intended 'skip the wait' exit instead of asserting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant