From 754872e2c442d97f98acd07ebe90f37c86ffd105 Mon Sep 17 00:00:00 2001 From: sjaakola Date: Tue, 7 Apr 2020 10:34:08 +0300 Subject: [PATCH] recording GTID checkpoint before leaving commit monitor This fix relates to github bug #607, where wrong wsrep XID store order caused assert in innodb wsrep checkpointing. Wrong store order happened after certification failure, where the failing transaction rushed to record wsrep XID bebfore the offending applier transaction. This race condition was possible because the applier released first commit monitor and after that recorded wsrep XID as innodb checkpoint. The fix for this issue forces all wsrep GTID checkpointing to happen inside commit monitor. Hence, a fix for this wsrep-lib routine was needed, to align with the checkpoinnting logic, and record checkpoint just before leaving commit monitor. --- src/transaction.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/transaction.cpp b/src/transaction.cpp index 37dc0d1..1b55028 100644 --- a/src/transaction.cpp +++ b/src/transaction.cpp @@ -528,6 +528,7 @@ int wsrep::transaction::ordered_commit() assert(state() == s_committing); assert(ordered()); client_service_.debug_sync("wsrep_before_commit_order_leave"); + server_service_.set_position(client_service_, ws_meta_.gtid()); int ret(provider().commit_order_leave(ws_handle_, ws_meta_, apply_error_buf_)); client_service_.debug_sync("wsrep_after_commit_order_leave");