mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fixes to streaming replication BF aborts
The InnoDB DeadlockChecker::check_and_resolve() was missing a call to wsrep_handle_SR_rollback() in the case when the transaction running deadlock detection was chosen as victim. Refined wsrep_handle_SR_rollback() to skip store_globals() calls if the transaction was BF aborting itself. Made mysql-wsrep-features#165 more deterministic by waiting until the update is in progress before sending next update.
This commit is contained in:
committed by
Jan Lindström
parent
31b65d3dd2
commit
6edfeb82fd
File diff suppressed because it is too large
Load Diff
@@ -53,6 +53,10 @@ SELECT * FROM t1;
|
||||
--connection node_1a
|
||||
--send UPDATE t1 SET f2 = 'a' WHERE f1 = 2
|
||||
|
||||
--connection node_1
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER != 'system user' AND STATE = 'Updating';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
# Will deadlock
|
||||
--connection node_1b
|
||||
SET DEBUG_SYNC = 'wsrep_before_SR_rollback SIGNAL wait WAIT_FOR continue';
|
||||
@@ -101,4 +105,5 @@ SELECT * FROM t1;
|
||||
SELECT * FROM t1;
|
||||
|
||||
--connection node_1
|
||||
SET DEBUG_SYNC = 'RESET';
|
||||
DROP TABLE t1;
|
||||
|
@@ -145,8 +145,11 @@ extern "C" void wsrep_handle_SR_rollback(THD *bf_thd,
|
||||
victim_thd->wsrep_trx_id(),
|
||||
victim_thd->wsrep_sr().fragments_certified(),
|
||||
wsrep_thd_transaction_state_str(victim_thd));
|
||||
if (bf_thd) victim_thd->store_globals();
|
||||
if (!bf_thd)
|
||||
if (bf_thd && bf_thd != victim_thd)
|
||||
{
|
||||
victim_thd->store_globals();
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_SYNC(victim_thd, "wsrep_before_SR_rollback");
|
||||
}
|
||||
@@ -158,7 +161,10 @@ extern "C" void wsrep_handle_SR_rollback(THD *bf_thd,
|
||||
{
|
||||
wsrep_thd_self_abort(victim_thd);
|
||||
}
|
||||
if (bf_thd) bf_thd->store_globals();
|
||||
if (bf_thd && bf_thd != victim_thd)
|
||||
{
|
||||
bf_thd->store_globals();
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" my_bool wsrep_thd_bf_abort(const THD *bf_thd, THD *victim_thd,
|
||||
|
@@ -7084,6 +7084,12 @@ DeadlockChecker::check_and_resolve(const lock_t* lock, trx_t* trx)
|
||||
if (victim_trx != NULL) {
|
||||
|
||||
print("*** WE ROLL BACK TRANSACTION (2)\n");
|
||||
#ifdef WITH_WSREP
|
||||
if (wsrep_on(trx->mysql_thd)) {
|
||||
wsrep_handle_SR_rollback(trx->mysql_thd,
|
||||
victim_trx->mysql_thd);
|
||||
}
|
||||
#endif
|
||||
|
||||
lock_deadlock_found = true;
|
||||
}
|
||||
|
Submodule wsrep-lib updated: 0b09871ad5...ab0e5f5d77
Reference in New Issue
Block a user