Skip to content

Commit 9ea5de3

Browse files
author
Jan Lindström
committed
Merge branch 'sensssz-10.2-vats' into 10.2
2 parents 3371904 + 7f504c7 commit 9ea5de3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

storage/innobase/lock/lock0lock.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,9 +1754,9 @@ RecLock::lock_alloc(
17541754
/*********************************************************************//**
17551755
Check if lock1 has higher priority than lock2.
17561756
NULL has lowest priority.
1757-
If either is a high priority transaction, the lock has higher priority.
17581757
If neither of them is wait lock, the first one has higher priority.
17591758
If only one of them is a wait lock, it has lower priority.
1759+
If either is a high priority transaction, the lock has higher priority.
17601760
Otherwise, the one with an older transaction has higher priority.
17611761
@returns true if lock1 has higher priority, false otherwise. */
17621762
bool
@@ -1769,12 +1769,15 @@ has_higher_priority(
17691769
} else if (lock2 == NULL) {
17701770
return true;
17711771
}
1772-
// No preference. Compre them by wait mode and trx age.
1772+
// Granted locks has higher priority.
17731773
if (!lock_get_wait(lock1)) {
17741774
return true;
17751775
} else if (!lock_get_wait(lock2)) {
17761776
return false;
17771777
}
1778+
if (trx_is_high_priority(lock1->trx)) {
1779+
return false;
1780+
}
17781781
return lock1->trx->start_time_micro <= lock2->trx->start_time_micro;
17791782
}
17801783

0 commit comments

Comments
 (0)