Skip to content

Commit c43db43

Browse files
Daniele Sciasciasysprg
authored andcommitted
MENT-2038 Assert WSREP(thd) fails in wsrep_restore_kill_after_commit
Fix wrong assertion: function wsrep_restore_kill_after_commit() asserts `WSREP(thd)`, however for the caller (wsrep_after_statement()) it is enough that the THD has an active transaction. Fixed the assertion accordingly. Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
1 parent 479a583 commit c43db43

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
connection node_2;
2+
connection node_1;
3+
SET SESSION wsrep_on=OFF;
4+
BEGIN;
5+
BEGIN;
6+
COMMIT;
7+
SET SESSION wsrep_on=ON;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# MENT-2038: Assertion `(thd && (WSREP_PROVIDER_EXISTS_ && thd->variables.wsrep_on))'
3+
# failed in void wsrep_restore_kill_after_commit(THD*)
4+
#
5+
6+
--source include/galera_cluster.inc
7+
8+
SET SESSION wsrep_on=OFF;
9+
BEGIN;
10+
BEGIN; # If bug is present, assertion triggers during implicit commit
11+
COMMIT;
12+
SET SESSION wsrep_on=ON;

sql/wsrep_thd.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ void wsrep_backup_kill_for_commit(THD *thd)
496496

497497
void wsrep_restore_kill_after_commit(THD *thd)
498498
{
499-
DBUG_ASSERT(WSREP(thd));
499+
DBUG_ASSERT(wsrep_is_active(thd));
500500
mysql_mutex_assert_owner(&thd->LOCK_thd_kill);
501501
thd->killed= thd->wsrep_abort_by_kill;
502502
my_free(thd->killed_err);

0 commit comments

Comments
 (0)