mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
MDEV-4233: Galera: assertion: (lock->trx)->wait_lock == lock fails in file lock0lock.c line 796
Analysis: Assertion means that InnoDB transaction lock queue is not correctly set. Reason seams to be the fact that wrong lock is cancelled. Fix: We have selected c_lock to be cancelled. Thus we should cancel and release lock that is waiting for this lock i.e. c_lock->trx->wait_lock.
This commit is contained in:
parent
88f0e0ebee
commit
480753972a
2 changed files with 36 additions and 8 deletions
|
@ -3960,11 +3960,25 @@ lock_table_create(
|
|||
}
|
||||
|
||||
if (c_lock && c_lock->trx->que_state == TRX_QUE_LOCK_WAIT) {
|
||||
if (wsrep_debug)
|
||||
fprintf(stderr, "WSREP: table c_lock in wait: %llu\n",
|
||||
(ulonglong) lock->trx->id);
|
||||
if (wsrep_debug) {
|
||||
fprintf(stderr, "WSREP: table c_lock in wait: %llu new loc: %llu\n",
|
||||
(ulonglong) c_lock->trx->id, lock->trx->id);
|
||||
}
|
||||
|
||||
c_lock->trx->was_chosen_as_deadlock_victim = TRUE;
|
||||
lock_cancel_waiting_and_release(c_lock);
|
||||
lock_cancel_waiting_and_release(c_lock->trx->wait_lock);
|
||||
|
||||
/* trx might not wait for c_lock, but some other lock
|
||||
does not matter if wait_lock was released above
|
||||
*/
|
||||
if (c_lock->trx->wait_lock == c_lock) {
|
||||
lock_reset_lock_and_trx_wait(lock);
|
||||
}
|
||||
|
||||
if (wsrep_debug) {
|
||||
fprintf(stderr, "WSREP: c_lock canceled %llu\n",
|
||||
(ulonglong) c_lock->trx->id);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
|
|
@ -3943,11 +3943,25 @@ lock_table_create(
|
|||
}
|
||||
|
||||
if (c_lock && c_lock->trx->que_state == TRX_QUE_LOCK_WAIT) {
|
||||
if (wsrep_debug)
|
||||
fprintf(stderr, "WSREP: table c_lock in wait: %llu\n",
|
||||
(ulonglong) lock->trx->id);
|
||||
if (wsrep_debug) {
|
||||
fprintf(stderr, "WSREP: table c_lock in wait: %llu new loc: %llu\n",
|
||||
(ulonglong) c_lock->trx->id, lock->trx->id);
|
||||
}
|
||||
|
||||
c_lock->trx->was_chosen_as_deadlock_victim = TRUE;
|
||||
lock_cancel_waiting_and_release(c_lock);
|
||||
lock_cancel_waiting_and_release(c_lock->trx->wait_lock);
|
||||
|
||||
/* trx might not wait for c_lock, but some other lock
|
||||
does not matter if wait_lock was released above
|
||||
*/
|
||||
if (c_lock->trx->wait_lock == c_lock) {
|
||||
lock_reset_lock_and_trx_wait(lock);
|
||||
}
|
||||
|
||||
if (wsrep_debug) {
|
||||
fprintf(stderr, "WSREP: c_lock canceled %llu\n",
|
||||
(ulonglong) c_lock->trx->id);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
|
Loading…
Add table
Reference in a new issue