rocksdb/utilities/transactions
Manuel Ung 2005c88a75 Implement non-exclusive locks
Summary:
This is an implementation of non-exclusive locks for pessimistic transactions. It is relatively simple and does not prevent starvation (ie. it's possible that request for exclusive access will never be granted if there are always threads holding shared access). It is done by changing `KeyLockInfo` to hold an set a transaction ids, instead of just one, and adding a flag specifying whether this lock is currently held with exclusive access or not.

Some implementation notes:
- Some lock diagnostic functions had to be updated to return a set of transaction ids for a given lock, eg. `GetWaitingTxn` and `GetLockStatusData`.
- Deadlock detection is a bit more complicated since a transaction can now wait on multiple other transactions. A BFS is done in this case, and deadlock detection depth is now just a limit on the number of transactions we visit.
- Expirable transactions do not work efficiently with shared locks at the moment, but that's okay for now.
Closes https://github.com/facebook/rocksdb/pull/1573

Differential Revision: D4239097

Pulled By: lth

fbshipit-source-id: da7c074
2016-12-05 17:39:17 -08:00
..
optimistic_transaction_db_impl.cc optimistic transactions support for reinitialization 2016-03-07 19:03:09 -08:00
optimistic_transaction_db_impl.h optimistic transactions support for reinitialization 2016-03-07 19:03:09 -08:00
optimistic_transaction_impl.cc Implement non-exclusive locks 2016-12-05 17:39:17 -08:00
optimistic_transaction_impl.h Implement non-exclusive locks 2016-12-05 17:39:17 -08:00
optimistic_transaction_test.cc Use correct sequence number when creating memtable 2016-11-09 12:24:17 -08:00
transaction_base.cc Implement non-exclusive locks 2016-12-05 17:39:17 -08:00
transaction_base.h Implement non-exclusive locks 2016-12-05 17:39:17 -08:00
transaction_db_impl.cc Implement non-exclusive locks 2016-12-05 17:39:17 -08:00
transaction_db_impl.h Implement non-exclusive locks 2016-12-05 17:39:17 -08:00
transaction_db_mutex_impl.cc Fix transaction locking 2016-02-16 17:15:05 -08:00
transaction_db_mutex_impl.h Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
transaction_impl.cc Implement non-exclusive locks 2016-12-05 17:39:17 -08:00
transaction_impl.h Implement non-exclusive locks 2016-12-05 17:39:17 -08:00
transaction_lock_mgr.cc Implement non-exclusive locks 2016-12-05 17:39:17 -08:00
transaction_lock_mgr.h Implement non-exclusive locks 2016-12-05 17:39:17 -08:00
transaction_test.cc Implement non-exclusive locks 2016-12-05 17:39:17 -08:00
transaction_util.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
transaction_util.h Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00