rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree
Sergei Petrunia c9878baa87 Fix an assertion failure in range locking, locktree code. (#7938)
Summary:
Fix this scenario:
trx1> acquire shared lock on $key
trx2> acquire shared lock on the same $key
trx1> attempt to acquire a unique lock on $key.

Lock acquisition will fail, and deadlock detection will start.
It will call iterate_and_get_overlapping_row_locks() which will
produce a list with two locks (shared locks by trx1 and trx2).

However the code in lock_request::build_wait_graph() was not prepared
to find the lock by the same transaction in the list of conflicting
locks. Fix it to ignore it.

(One may suggest to fix iterate_and_get_overlapping_row_locks() to not
include locks by trx1. This is not a good idea, because that function
is also used to report all locks currently held)

Pull Request resolved: https://github.com/facebook/rocksdb/pull/7938

Reviewed By: zhichao-cao

Differential Revision: D26529374

Pulled By: ajkr

fbshipit-source-id: d89cbed008db1a97a8f2351b9bfb75310750d16a
2021-02-18 18:15:19 -08:00
..
concurrent_tree.cc LockTree library, originally from PerconaFT (#7753) 2020-12-09 12:10:57 -08:00
concurrent_tree.h LockTree library, originally from PerconaFT (#7753) 2020-12-09 12:10:57 -08:00
keyrange.cc Apply the changes from: PS-5501 : Re-license PerconaFT 'locktree' to Apache V2 (#7801) 2020-12-22 14:47:41 -08:00
keyrange.h Apply the changes from: PS-5501 : Re-license PerconaFT 'locktree' to Apache V2 (#7801) 2020-12-22 14:47:41 -08:00
lock_request.cc Range Locking: Implementation of range locking (#7506) 2020-12-22 19:12:36 -08:00
lock_request.h Range Locking: Implementation of range locking (#7506) 2020-12-22 19:12:36 -08:00
locktree.cc Fix an assertion failure in range locking, locktree code. (#7938) 2021-02-18 18:15:19 -08:00
locktree.h Apply the changes from: PS-5501 : Re-license PerconaFT 'locktree' to Apache V2 (#7801) 2020-12-22 14:47:41 -08:00
manager.cc Apply the changes from: PS-5501 : Re-license PerconaFT 'locktree' to Apache V2 (#7801) 2020-12-22 14:47:41 -08:00
range_buffer.cc Apply the changes from: PS-5501 : Re-license PerconaFT 'locktree' to Apache V2 (#7801) 2020-12-22 14:47:41 -08:00
range_buffer.h Apply the changes from: PS-5501 : Re-license PerconaFT 'locktree' to Apache V2 (#7801) 2020-12-22 14:47:41 -08:00
treenode.cc Apply the changes from: PS-5501 : Re-license PerconaFT 'locktree' to Apache V2 (#7801) 2020-12-22 14:47:41 -08:00
treenode.h Apply the changes from: PS-5501 : Re-license PerconaFT 'locktree' to Apache V2 (#7801) 2020-12-22 14:47:41 -08:00
txnid_set.cc Apply the changes from: PS-5501 : Re-license PerconaFT 'locktree' to Apache V2 (#7801) 2020-12-22 14:47:41 -08:00
txnid_set.h Apply the changes from: PS-5501 : Re-license PerconaFT 'locktree' to Apache V2 (#7801) 2020-12-22 14:47:41 -08:00
wfg.cc Apply the changes from: PS-5501 : Re-license PerconaFT 'locktree' to Apache V2 (#7801) 2020-12-22 14:47:41 -08:00
wfg.h Apply the changes from: PS-5501 : Re-license PerconaFT 'locktree' to Apache V2 (#7801) 2020-12-22 14:47:41 -08:00