rocksdb/utilities/transactions
Andrew Kryczka 5d6005c780 Add WriteOptions::protection_bytes_per_key (#10037)
Summary:
Added an option, `WriteOptions::protection_bytes_per_key`, that controls how many bytes per key we use for integrity protection in `WriteBatch`. It takes effect when `WriteBatch::GetProtectionBytesPerKey() == 0`.

Currently the only supported value is eight. Invoking a user API with it set to any other nonzero value will result in `Status::NotSupported` returned to the user.

There is also a bug fix for integrity protection with `inplace_callback`, where we forgot to take into account the possible change in varint length when calculating KV checksum for the final encoded buffer.

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

Test Plan:
- Manual
  - Set default value of `WriteOptions::protection_bytes_per_key` to eight and ran `make check -j24`
  - Enabled in MyShadow for 1+ week
- Automated
  - Unit tests have a `WriteMode` that enables the integrity protection via `WriteOptions`
  - Crash test - in most cases, use `WriteOptions::protection_bytes_per_key` to enable integrity protection

Reviewed By: cbi42

Differential Revision: D36614569

Pulled By: ajkr

fbshipit-source-id: 8650087ceac9b61b560f1e5fafe5e1baf9c725fb
2022-06-16 23:10:07 -07:00
..
lock fix: build on risc-v (#9215) 2022-05-17 17:33:01 -07: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
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 Revise APIs related to user-defined timestamp (#8946) 2022-02-01 22:19:01 -08:00
optimistic_transaction_test.cc Snapshots with user-specified timestamps (#9879) 2022-06-10 16:07:03 -07:00
pessimistic_transaction.cc Snapshots with user-specified timestamps (#9879) 2022-06-10 16:07:03 -07:00
pessimistic_transaction.h Snapshots with user-specified timestamps (#9879) 2022-06-10 16:07:03 -07:00
pessimistic_transaction_db.cc Snapshots with user-specified timestamps (#9879) 2022-06-10 16:07:03 -07:00
pessimistic_transaction_db.h Add WriteOptions::protection_bytes_per_key (#10037) 2022-06-16 23:10:07 -07:00
snapshot_checker.cc Use STATIC_AVOID_DESTRUCTION for static objects with non-trivial destructors (#9958) 2022-05-17 09:39:22 -07:00
timestamped_snapshot_test.cc Snapshots with user-specified timestamps (#9879) 2022-06-10 16:07:03 -07:00
transaction_base.cc Add WriteOptions::protection_bytes_per_key (#10037) 2022-06-16 23:10:07 -07:00
transaction_base.h Snapshots with user-specified timestamps (#9879) 2022-06-10 16:07:03 -07: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 Snapshots with user-specified timestamps (#9879) 2022-06-10 16:07:03 -07:00
transaction_test.h Snapshots with user-specified timestamps (#9879) 2022-06-10 16:07:03 -07:00
transaction_util.cc Remove own ToString() (#9955) 2022-05-06 13:03:58 -07:00
transaction_util.h Update TransactionUtil::CheckKeyForConflict to also use timestamps (#9162) 2021-11-15 12:52:18 -08:00
write_committed_transaction_ts_test.cc Point-lookup returns timestamps of Delete and SingleDelete (#10056) 2022-06-03 20:00:42 -07:00
write_prepared_transaction_test.cc Remove own ToString() (#9955) 2022-05-06 13:03:58 -07:00
write_prepared_txn.cc Add WriteOptions::protection_bytes_per_key (#10037) 2022-06-16 23:10:07 -07:00
write_prepared_txn.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
write_prepared_txn_db.cc Add WriteOptions::protection_bytes_per_key (#10037) 2022-06-16 23:10:07 -07:00
write_prepared_txn_db.h Remove own ToString() (#9955) 2022-05-06 13:03:58 -07:00
write_unprepared_transaction_test.cc Remove own ToString() (#9955) 2022-05-06 13:03:58 -07:00
write_unprepared_txn.cc Add WriteOptions::protection_bytes_per_key (#10037) 2022-06-16 23:10:07 -07:00
write_unprepared_txn.h Replace tracked_keys with a new LockTracker interface in TransactionDB (#7013) 2020-08-06 12:38:00 -07:00
write_unprepared_txn_db.cc Add WriteOptions::protection_bytes_per_key (#10037) 2022-06-16 23:10:07 -07:00
write_unprepared_txn_db.h WriteUnPrepared: Pass in correct subbatch count during rollback (#6463) 2020-02-28 11:19:32 -08:00