server
server copied to clipboard
MDEV-34122: Assertion entry failed in Active_tranx::assert_thd_is_waiter
In between the binlogging of a transaction and its wait, it is possible that its entry in Active_tranx was removed if semi-sync was switched off and on. This fires an assertion that checks before awaiting an ACK that the entry must exist in Active_tranx.
The fix is to ensure that the entry exists before awaiting the ACK, and if there is no entry, write an informative message to the user explaining that the transaction is skipping its wait. Additionally, debug-build only logic is added to ensure that the cause of the missing entry is due to semi-sync being turned off and on.
Initial PR organized as three commits:
- Regression MTR test to show the problem
- Fix
- Extension to the test/result to ensure informational note is provided
A general note, I'm not thrilled about moving is_thd_waiter() to be in non-debug builds, but I also can't think of another way without adding overhead to every thread. I thought about making it part of clear_active_tranx_nodes() call to signal_waiting_transaction(), and reusing existing variables (e.g. by resetting thd->semisync_info) but it doesn't work well group commit.