summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeemu Ollakka <teemu.ollakka@galeracluster.com>2023-02-13 18:14:50 +0200
committerJulius Goryavsky <julius.goryavsky@mariadb.com>2023-02-21 00:46:05 +0100
commitfaa91e5aefe45f15bbc2447500dbd5218294e4b4 (patch)
treeaee52dbe7721a9393c88036cb997e00e212f5cd7
parent67a6ad0a4a36bd59fabbdd6b1cdd38de54e82c79 (diff)
downloadmariadb-git-bb-10.6-MDEV-27317-galera.tar.gz
MDEV-27317 wsrep_checkpoint order violation due to certification failurebb-10.6-MDEV-27317-galera
With binlogs enabled, debug assertion ut_ad(xid_seqno > wsrep_seqno) fired in trx_rseg_update_wsrep_checkpoint() when an applier thread synced the seqno out of order for write set which had failed certification. This was caused by releasing commit order too early when binlogs were on, allowing group commit to run in parallel and commit following transactions too early. Fixed by extending the commit order critical section to cover call to wsrep_set_SE_checkpoint() also when binlogs are on. Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
-rw-r--r--sql/wsrep_high_priority_service.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/sql/wsrep_high_priority_service.cc b/sql/wsrep_high_priority_service.cc
index 7d8296a75a1..d9988914c4d 100644
--- a/sql/wsrep_high_priority_service.cc
+++ b/sql/wsrep_high_priority_service.cc
@@ -502,7 +502,13 @@ int Wsrep_high_priority_service::log_dummy_write_set(const wsrep::ws_handle& ws_
if (!WSREP_EMULATE_BINLOG(m_thd))
{
wsrep_register_for_group_commit(m_thd);
- ret = ret || cs.provider().commit_order_leave(ws_handle, ws_meta, err);
+ /* wait_for_prior_commit() ensures that all preceding transactions
+ have been committed and seqno has been synced into
+ storage engine. We don't release commit order here yet to
+ avoid following transactions to sync seqno before
+ wsrep_set_SE_checkpoint() below returns. This effectively pauses
+ group commit for the checkpoint operation, but is the only way to
+ ensure proper ordering. */
m_thd->wait_for_prior_commit();
}
@@ -512,10 +518,7 @@ int Wsrep_high_priority_service::log_dummy_write_set(const wsrep::ws_handle& ws_
{
wsrep_unregister_from_group_commit(m_thd);
}
- else
- {
- ret= ret || cs.provider().commit_order_leave(ws_handle, ws_meta, err);
- }
+ ret= ret || cs.provider().commit_order_leave(ws_handle, ws_meta, err);
cs.after_applying();
}
DBUG_RETURN(ret);