summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsjaakola <seppo.jaakola@iki.fi>2020-12-02 20:52:35 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2020-12-17 09:14:49 +0200
commit41a961d85c9a083c816a9f628d97786964d208a5 (patch)
tree415eae8f635c75bbc793ac6c78676cade5c1ed11
parent87fa6d2c5c74338bcba8254a663400b49840172e (diff)
downloadmariadb-git-bb-10.4-MDEV-24327.tar.gz
MDEV-24327 wsrep XID checkpointing order violation with cert failuresbb-10.4-MDEV-24327
Handling of write sets, which fail in certification happens differently than with write sets which pass certification. When certification fails, the write set applying can be skipped and applier needs only to take care of wsrep XID checkpointing. With current implementation, this can rush ahead of wsrep XID checkpointing of successful write sets. The fix in this PR registers wsrep XID checkpointing of certification failure cases in group commit, which guarantees that XID ceckpointing order is synchronized with real committing transactions. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
-rw-r--r--sql/wsrep_binlog.cc4
-rw-r--r--sql/wsrep_high_priority_service.cc18
2 files changed, 19 insertions, 3 deletions
diff --git a/sql/wsrep_binlog.cc b/sql/wsrep_binlog.cc
index 787ebc042ae..d04d9989e99 100644
--- a/sql/wsrep_binlog.cc
+++ b/sql/wsrep_binlog.cc
@@ -358,7 +358,7 @@ void wsrep_register_for_group_commit(THD *thd)
DBUG_VOID_RETURN;
}
- DBUG_ASSERT(thd->wsrep_trx().state() == wsrep::transaction::s_committing);
+ DBUG_ASSERT(thd->wsrep_trx().ordered());
wait_for_commit *wfc= thd->wait_for_commit_ptr= &thd->wsrep_wfc;
@@ -381,7 +381,7 @@ void wsrep_register_for_group_commit(THD *thd)
void wsrep_unregister_from_group_commit(THD *thd)
{
- DBUG_ASSERT(thd->wsrep_trx().state() == wsrep::transaction::s_ordered_commit);
+ DBUG_ASSERT(thd->wsrep_trx().ordered());
wait_for_commit *wfc= thd->wait_for_commit_ptr;
if (wfc)
diff --git a/sql/wsrep_high_priority_service.cc b/sql/wsrep_high_priority_service.cc
index 341c409b4f2..1adbb312ac0 100644
--- a/sql/wsrep_high_priority_service.cc
+++ b/sql/wsrep_high_priority_service.cc
@@ -443,8 +443,24 @@ int Wsrep_high_priority_service::log_dummy_write_set(const wsrep::ws_handle& ws_
cs.before_rollback();
cs.after_rollback();
}
+
+ 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);
+ m_thd->wait_for_prior_commit();
+ }
+
wsrep_set_SE_checkpoint(ws_meta.gtid());
- ret= ret || cs.provider().commit_order_leave(ws_handle, ws_meta, err);
+
+ if (!WSREP_EMULATE_BINLOG(m_thd))
+ {
+ wsrep_unregister_from_group_commit(m_thd);
+ }
+ else
+ {
+ ret= ret || cs.provider().commit_order_leave(ws_handle, ws_meta, err);
+ }
cs.after_applying();
}
DBUG_RETURN(ret);