-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stress/Crash Test for OptimisticTransactionDB #11513
Stress/Crash Test for OptimisticTransactionDB #11513
Conversation
363d7cb
to
3c61e8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start. Doesn't look like this is connected up to the transaction testing code that is guarded by FLAGS_use_txn, though that could be put in a next PR. We will need to essentially audit all those places and decide which apply to OTDB. You can decide how to resolve mixing --use_txn and --use_optimistic_txn options, or not mixing, and whether it makes sense to keep checking FLAGS_use_txn or to introduce another variable for transactions in general.
@@ -37,6 +39,11 @@ crash_test_with_txn: $(DB_STRESS_CMD) | |||
$(CRASHTEST_MAKE) whitebox_crash_test_with_txn | |||
$(CRASHTEST_MAKE) blackbox_crash_test_with_txn | |||
|
|||
crash_test_with_optimistic_txn: $(DB_STRESS_CMD) | |||
# Do not parallelize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wondering why we shouldn't parallelize. (copied from other tests as I assume the requirement is the same for OTDB, but I'd love to learn)
0017999
to
0099e44
Compare
@jaykorean has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@jaykorean has updated the pull request. You must reimport the pull request before landing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! (Be sure to re-import)
@jaykorean has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@jaykorean merged this pull request in 17d5200. |
Context:
OptimisticTransactionDB has not been covered by db_stress (including crash test) like TransactionDB.
Summary:
use_optimistic_txn
: When true, open OptimisticTransactionDB to testocc_validation_policy
:OccValidationPolicy::kValidateParallel = 1
by default.share_occ_lock_buckets
: Use shared occ locksocc_lock_bucket_count
: 500 by default. Number of buckets to use for shared occ lock.use_optimistic_txn
flag indb_stress_test_base.cc
Please note that the existing flag
use_txn
is being used here. Whenuse_txn == true
anduse_optimistic_txn == false
, we useTransactionDB
(a.k.a. pessimistic transaction db). When bothuse_txn
anduse_optimistic_txn
are true, we useOptimisticTransactionDB
. Ifuse_txn == false
butuse_optimistic_txn == true
throw error with message "You cannot set use_optimistic_txn true while use_txn is false. Please set use_txn true if you want to use OptimisticTransactionDB".Test Plan:
Crash Test
Serial Validation
Parallel Validation (no share bucket)
Parallel Validation (share bucket)
Stress Test