summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorTeemu Ollakka <teemu.ollakka@galeracluster.com>2019-01-24 16:31:33 +0200
committerTeemu Ollakka <teemu.ollakka@galeracluster.com>2019-01-25 16:19:20 +0200
commit040b840de7bcd32b0236531a7aec95b11341cef3 (patch)
tree27dca70bcb2d2a7c67b93a10cdee4ce788a101b4 /storage
parentce28fa53032dd7c233ed4875514bf85eafec0bc4 (diff)
downloadmariadb-git-040b840de7bcd32b0236531a7aec95b11341cef3.tar.gz
MDEV-15740 Backport wsrep recovery fixes from 10.4.
Clear wsrep XID in innobase_rollback_by_xid() for recovered wsrep transaction in order to avoid resetting XID storage when rolling back wsrep transaction during recovery. Sort wsrep XIDs read from storage engine in ascending order and erify that the range is continuous during crash recovery. If binlog is off, commit all recovered transactions for continuous seqno range. This is safe because all transactions with wsrep XID have been certified and must be committed in the cluster. On the other hand if binlog is on, respect binlog as a transaction coordinator in order to avoid missing transactions in binlog that have been committed into storage engine .
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/handler/ha_innodb.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 3e68e2d1d4a..dde12e5c2d5 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -17260,6 +17260,14 @@ innobase_rollback_by_xid(
}
if (trx_t* trx = trx_get_trx_by_xid(xid)) {
+#ifdef WITH_WSREP
+ /* If a wsrep transaction is being rolled back during
+ the recovery, we must clear the xid in order to avoid
+ writing serialisation history for rolled back transaction. */
+ if (wsrep_is_wsrep_xid(trx->xid)) {
+ trx->xid->null();
+ }
+#endif /* WITH_WSREP */
int ret = innobase_rollback_trx(trx);
trx_deregister_from_2pc(trx);
ut_ad(!trx->will_lock);