rocksdb/utilities/transactions
Maysam Yabandeh bb2a2ec731 WritePrepared Txn: rollback via commit
Summary:
Currently WritePrepared rolls back a transaction with prepare sequence number prepare_seq by i) write a single rollback batch with rollback_seq, ii) add <rollback_seq, rollback_seq> to commit cache, iii) remove prepare_seq from PrepareHeap.
This is correct assuming that there is no snapshot taken when a transaction is rolled back. This is the case the way MySQL does rollback which is after recovery. Otherwise if max_evicted_seq advances the prepare_seq, the live snapshot might assume data as committed since it does not find them in CommitCache.
The change is to simply add <prepare_seq. rollback_seq> to commit cache before removing prepare_seq from PrepareHeap. In this way if max_evicted_seq advances prpeare_seq, the existing mechanism that we have to check evicted entries against live snapshots will make sure that the live snapshot will not see the data of rolled back transaction.
Closes https://github.com/facebook/rocksdb/pull/3745

Differential Revision: D7696193

Pulled By: maysamyabandeh

fbshipit-source-id: c9a2d46341ddc03554dded1303520a1cab74ef9c
2018-04-20 15:28:19 -07:00
..
optimistic_transaction_db_impl.cc Refactor PessimisticTransaction 2017-08-07 16:12:29 -07:00
optimistic_transaction_db_impl.h Make Optimistic Tx database stackable 2018-04-03 15:28:40 -07:00
optimistic_transaction_test.cc fix memory leak in two_level_iterator 2018-04-15 17:26:26 -07:00
optimistic_transaction.cc Update WritePrepared with the pseudo code 2017-08-16 16:57:47 -07:00
optimistic_transaction.h Update WritePrepared with the pseudo code 2017-08-16 16:57:47 -07:00
pessimistic_transaction_db.cc Fix some typos in comments and docs. 2018-03-08 10:27:25 -08:00
pessimistic_transaction_db.h WritePrepared Txn: smallest_prepare optimization 2018-04-02 20:27:41 -07:00
pessimistic_transaction.cc WritePrepared Txn: Duplicate Keys, Txn Part 2018-02-05 18:43:24 -08:00
pessimistic_transaction.h WritePrepared Txn: Duplicate Keys, Txn Part 2018-02-05 18:43:24 -08:00
snapshot_checker.cc comment unused parameters to turn on -Wunused-parameter flag 2018-04-12 17:59:16 -07:00
transaction_base.cc Suppress unused warnings 2018-02-02 12:27:07 -08:00
transaction_base.h WritePrepared Txn: smallest_prepare optimization 2018-04-02 20:27:41 -07:00
transaction_db_mutex_impl.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
transaction_db_mutex_impl.h Change RocksDB License 2017-07-15 16:11:23 -07:00
transaction_lock_mgr.cc comment unused parameters to turn on -Wunused-parameter flag 2018-04-12 17:59:16 -07:00
transaction_lock_mgr.h Added mechanism to track deadlock chain 2017-08-17 18:56:21 -07:00
transaction_test.cc fix memory leak in two_level_iterator 2018-04-15 17:26:26 -07:00
transaction_test.h WritePrepared Txn: enable TryAgain for duplicates at the end of the batch 2018-04-20 15:28:19 -07:00
transaction_util.cc WritePrepared Txn: ValidateSnapshot 2017-11-01 19:11:09 -07:00
transaction_util.h WritePrepared Txn: ValidateSnapshot 2017-11-01 19:11:09 -07:00
write_prepared_transaction_test.cc fix memory leak in two_level_iterator 2018-04-15 17:26:26 -07:00
write_prepared_txn_db.cc WritePrepared Txn: rollback via commit 2018-04-20 15:28:19 -07:00
write_prepared_txn_db.h WritePrepared Txn: rollback via commit 2018-04-20 15:28:19 -07:00
write_prepared_txn.cc WritePrepared Txn: rollback via commit 2018-04-20 15:28:19 -07:00
write_prepared_txn.h WritePrepared Txn: smallest_prepare optimization 2018-04-02 20:27:41 -07:00