rocksdb/utilities/transactions
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
..
lock Fix an assertion failure in range locking, locktree code. (#7938) 2021-02-18 18:15:19 -08:00
optimistic_transaction_db_impl.cc Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
optimistic_transaction_db_impl.h Allow range deletions in *TransactionDB only when safe (#7929) 2021-02-05 15:57:26 -08:00
optimistic_transaction_test.cc Revert "Turn on memtable bloom filter by default. (#6584)" (#7939) 2021-02-06 22:34:30 -08:00
optimistic_transaction.cc Add further tests to ASSERT_STATUS_CHECKED (2) (#7698) 2020-12-09 21:21:16 -08:00
optimistic_transaction.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
pessimistic_transaction_db.cc Range Locking: Allow different LockManagers, add Range Lock definitions (#7443) 2020-12-07 20:18:07 -08:00
pessimistic_transaction_db.h Range Locking: Allow different LockManagers, add Range Lock definitions (#7443) 2020-12-07 20:18:07 -08:00
pessimistic_transaction.cc Range Locking: Allow different LockManagers, add Range Lock definitions (#7443) 2020-12-07 20:18:07 -08:00
pessimistic_transaction.h Range Locking: Allow different LockManagers, add Range Lock definitions (#7443) 2020-12-07 20:18:07 -08:00
snapshot_checker.cc Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
transaction_base.cc Fix unchecked statuses for transaction_test (#7572) 2020-10-21 14:03:59 -07:00
transaction_base.h Range Locking: Implementation of range locking (#7506) 2020-12-22 19:12:36 -08:00
transaction_db_mutex_impl.cc Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
transaction_db_mutex_impl.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
transaction_test.cc Fix txn MultiGet() return un-committed data with snapshot (#7963) 2021-02-18 08:49:00 -08:00
transaction_test.h Add further tests to ASSERT_STATUS_CHECKED (2) (#7698) 2020-12-09 21:21:16 -08:00
transaction_util.cc Replace tracked_keys with a new LockTracker interface in TransactionDB (#7013) 2020-08-06 12:38:00 -07:00
transaction_util.h Replace tracked_keys with a new LockTracker interface in TransactionDB (#7013) 2020-08-06 12:38:00 -07:00
write_prepared_transaction_test.cc Add further tests to ASSERT_STATUS_CHECKED (2) (#7698) 2020-12-09 21:21:16 -08:00
write_prepared_txn_db.cc Allow range deletions in *TransactionDB only when safe (#7929) 2021-02-05 15:57:26 -08:00
write_prepared_txn_db.h Abstract out LockManager interface (#7532) 2020-10-19 10:14:42 -07:00
write_prepared_txn.cc Add further tests to ASSERT_STATUS_CHECKED (2) (#7698) 2020-12-09 21:21:16 -08:00
write_prepared_txn.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
write_unprepared_transaction_test.cc Add further tests to ASSERT_STATUS_CHECKED (2) (#7698) 2020-12-09 21:21:16 -08:00
write_unprepared_txn_db.cc Add further tests to ASSERT_STATUS_CHECKED (2) (#7698) 2020-12-09 21:21:16 -08:00
write_unprepared_txn_db.h WriteUnPrepared: Pass in correct subbatch count during rollback (#6463) 2020-02-28 11:19:32 -08:00
write_unprepared_txn.cc Invalidate iterator on transaction clear (#7733) 2020-12-09 19:13:22 -08:00
write_unprepared_txn.h Replace tracked_keys with a new LockTracker interface in TransactionDB (#7013) 2020-08-06 12:38:00 -07:00