Commit fecc3bf
fix: remove panic on missing rangeLastWaitKey in lock conflict handler
The panic "BUG: missing range last wait key" can be triggered by a
legitimate race condition:
1. txn3 acquires range lock [k1,k4], conflicts with txn1 at k4
2. txn3 waiter is added to k4, rangeLastWaitKey set to k4
3. txn3 blocks in wait() — releases l.mu
4. txn1 unlocks k4: closeTxn() notifies txn3 waiter, isEmpty()
returns true, k4 is deleted from store
5. txn3 wakes, retries, conflicts at k2
6. handleLockConflictLocked tries to clean up old k4 waiter
7. k4 no longer exists → panic
Between step 3 (waiter blocks without lock) and step 6 (conflict
retry), another transaction can legitimately delete the lock entry.
The next line already guards with `if ok &&`, so removing the panic
is safe — the waiter was already cleaned up by the unlock path.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent ce192d9 commit fecc3bf
1 file changed
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | 550 | | |
554 | 551 | | |
555 | 552 | | |
| |||
0 commit comments