diff options
author | Yu Zhang <yuzhangyu@fb.com> | 2024-07-29 13:54:37 -0700 |
---|---|---|
committer | Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> | 2024-07-29 13:54:37 -0700 |
commit | 24d86f7b41627feb2e1f4ae0d3f857b920382698 (patch) | |
tree | e0ce7972f3fb04f0ce52cc0b9e9ff77a7a903a0f /include | |
parent | 408e8d4c85a091dff937a674fc88f361037110bf (diff) |
Add an option to toggle timestamp based validation for the whole DB (#12857)
Summary:
As titled. This PR adds a `TransactionDBOptions` field `enable_udt_validation` to allow user to toggle the timestamp based validation behavior across the whole DB. When it is true, which is the default value and the existing behavior. A recap of what this behavior is: `GetForUpdate` does timestamp based conflict checking to make sure no other transaction has committed a version of the key tagged with a timestamp equal to or newer than the calling transaction's `read_timestamp_` the user set via `SetReadTimestampForValidation`. When this field is set to false, we disable timestamp based validation for the whole DB. MyRocks find it hard to find a read timestamp for this validation API, so we added this flexibility.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/12857
Test Plan: Added unit test
Reviewed By: ltamasi
Differential Revision: D60194134
Pulled By: jowlyzhang
fbshipit-source-id: b8507f8ddc37fc7a2948cf492ce5c599ae646fef
Diffstat (limited to 'include')
-rw-r--r-- | include/rocksdb/utilities/transaction_db.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/rocksdb/utilities/transaction_db.h b/include/rocksdb/utilities/transaction_db.h index 3abd370b6..62aa78627 100644 --- a/include/rocksdb/utilities/transaction_db.h +++ b/include/rocksdb/utilities/transaction_db.h @@ -235,6 +235,11 @@ struct TransactionDBOptions { const Slice& /*key*/)> rollback_deletion_type_callback; + // A flag to control for the whole DB whether user-defined timestamp based + // validation are enabled when applicable. Only WriteCommittedTxn support + // user-defined timestamps so this option only applies in this case. + bool enable_udt_validation = true; + private: // 128 entries // Should the default value change, please also update wp_snapshot_cache_bits |