mirror of
https://github.com/MariaDB/server.git
synced 2025-11-15 02:06:13 +01:00
In the BASE of this patch when a slave parallel worker proceeds from the wait-for-prior-commit stage into retrying it may have its backup-lock related sub-state, specifically `THD::backup_commit_lock`, not reset, that is the pointer dangling. That caused segfault at the pointer's dereferencing in the worker retrying. The reason THD::backup_commit_lock is left dangling was unexpected state of THD having non-NULL of `THD::backup_commit_lock` and NULL of `mdl_backup.ticket`. This combination turns out possible when the slave worker is killed for retry *and* few instruction later it does not succeed to (re-)acquire the Backup MDL at exiting from `MYSQL_BIN_LOG::queue_for_group_commit()`. While it did not succeed it also did not expose that fact with timing out from `MDL_context::acquire_lock` and it did not have to, as it before to start waiting it found itself killed. The bug is fixed with amendment of `backup_commit_lock` reset condition at the end of `ha_commit_trans()`. The amended reset remains careful to affect only the stack allocated lock. A test is added to confirm the fixes with reproducing all stages described above. In the patch BASE it causes the segfault. |
||
|---|---|---|
| .. | ||
| extension | ||
| include | ||
| r | ||
| t | ||
| disabled.def | ||
| my.cnf | ||
| README | ||
| rpl_1slave_base.cnf | ||
How to run. =========== ./mysql-test-run.pl --suite=rpl --mysqld=--binlog-format=mixed