rocksdb/utilities/transactions
Manuel Ung fb571509a7 WriteUnPrepared: Enable WAL during crash recovery (#6418)
Summary:
Unfortunately, it seems like mysqld reuses xids across machine restarts. When that happens, we could have something like the following happening:

```
BEGIN_PREPARE(unprepared) Put(a) END_PREPARE(xid = 1)
-- crash and recover with Put(a) rolled back as it was not prepared
BEGIN_PREPARE(prepared) Put(b) END_PREPARE(xid = 1)
COMMIT(xid = 1)
-- crash and recover with both a, b
```

To solve this, we will have to log the rollback batch into the WAL during recovery.

WritePrepared already logs the rollback batch into the WAL, if a rollback happens after prepare, so there is no problem there.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6418

Differential Revision: D19896151

Pulled By: lth

fbshipit-source-id: 2ff65ddc5fe75efd57736fed4b7cd7a109d26609
2020-02-13 18:44:39 -08:00
..
optimistic_transaction_db_impl.cc parallel occ (#6240) 2020-01-07 14:20:38 -08:00
optimistic_transaction_db_impl.h parallel occ (#6240) 2020-01-07 14:20:38 -08:00
optimistic_transaction_test.cc parallel occ (#6240) 2020-01-07 14:20:38 -08:00
optimistic_transaction.cc parallel occ (#6240) 2020-01-07 14:20:38 -08:00
optimistic_transaction.h parallel occ (#6240) 2020-01-07 14:20:38 -08:00
pessimistic_transaction_db.cc replace some reinterpret_cast with static_cast_with_check (#5740) 2019-08-27 10:59:11 -07:00
pessimistic_transaction_db.h Double Crash in kPointInTimeRecovery with TransactionDB (#6313) 2020-01-29 11:40:55 -08:00
pessimistic_transaction.cc save a few redundant container lookups (#5875) 2019-10-07 12:28:09 -07:00
pessimistic_transaction.h Use delete to disable automatic generated methods. (#5009) 2019-09-11 18:09:00 -07:00
snapshot_checker.cc WriteUnPrepared: less virtual in iterator callback (#5049) 2019-04-02 14:47:16 -07:00
transaction_base.cc Fix compilation under MSVC VS2015 (#6081) 2019-11-26 18:24:09 -08:00
transaction_base.h Fix compilation under MSVC VS2015 (#6081) 2019-11-26 18:24:09 -08:00
transaction_db_mutex_impl.cc Apply modernize-use-override (2nd iteration) 2019-02-14 14:41:36 -08:00
transaction_db_mutex_impl.h Change RocksDB License 2017-07-15 16:11:23 -07:00
transaction_lock_mgr.cc Misc hashing updates / upgrades (#5909) 2019-10-24 17:16:46 -07:00
transaction_lock_mgr.h Use delete to disable automatic generated methods. (#5009) 2019-09-11 18:09:00 -07:00
transaction_test.cc Should flush and sync WAL when writing it in DB::Open() (#6417) 2020-02-13 18:41:04 -08:00
transaction_test.h Double Crash in kPointInTimeRecovery with TransactionDB (#6313) 2020-01-29 11:40:55 -08:00
transaction_util.cc use c++17's try_emplace if available (#5696) 2019-09-05 13:59:40 -07:00
transaction_util.h Fix PopSavePoint to merge info into the previous savepoint (#5628) 2019-07-26 11:39:30 -07:00
write_prepared_transaction_test.cc Shorten certain test names to avoid infra failure (#6352) 2020-01-30 23:10:24 -08:00
write_prepared_txn_db.cc Skip CancelAllBackgroundWork if DBImpl is already closed (#6268) 2020-01-07 15:34:27 -08:00
write_prepared_txn_db.h Shorten certain test names to avoid infra failure (#6352) 2020-01-30 23:10:24 -08:00
write_prepared_txn.cc Fix compilation under MSVC VS2015 (#6081) 2019-11-26 18:24:09 -08:00
write_prepared_txn.h Fix compilation under MSVC VS2015 (#6081) 2019-11-26 18:24:09 -08:00
write_unprepared_transaction_test.cc WriteUnPrepared: Split ReadYourOwnWriteStress to three (#5776) 2019-09-06 15:25:26 -07:00
write_unprepared_txn_db.cc WriteUnPrepared: Enable WAL during crash recovery (#6418) 2020-02-13 18:44:39 -08:00
write_unprepared_txn_db.h WriteUnPrepared: use tracked_keys_ to track keys needed for rollback (#5562) 2019-07-16 15:24:56 -07:00
write_unprepared_txn.cc Fix compilation under MSVC VS2015 (#6081) 2019-11-26 18:24:09 -08:00
write_unprepared_txn.h Fix compilation under MSVC VS2015 (#6081) 2019-11-26 18:24:09 -08:00