mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-26 16:30:56 +00:00
17d5200504
Summary: Context: OptimisticTransactionDB has not been covered by db_stress (including crash test) like TransactionDB. 1. Adding the following gflag options to to test OptimisticTransactionDB - `use_optimistic_txn`: When true, open OptimisticTransactionDB to test - `occ_validation_policy`: `OccValidationPolicy::kValidateParallel = 1` by default. - `share_occ_lock_buckets`: Use shared occ locks - `occ_lock_bucket_count`: 500 by default. Number of buckets to use for shared occ lock. 2. Opening OptimisticTransactionDB and NewTxn/Commit added per `use_optimistic_txn` flag in `db_stress_test_base.cc` 3. OptimisticTransactionDB blackbox/whitebox test added in crash_test.mk Please note that the existing flag `use_txn` is being used here. When `use_txn == true` and `use_optimistic_txn == false`, we use `TransactionDB` (a.k.a. pessimistic transaction db). When both `use_txn` and `use_optimistic_txn` are true, we use `OptimisticTransactionDB`. If `use_txn == false` but `use_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"_. Pull Request resolved: https://github.com/facebook/rocksdb/pull/11513 Test Plan: **Crash Test** Serial Validation ``` export CRASH_TEST_EXT_ARGS="--use_optimistic_txn=1 --use_txn=1 --use_put_entity_one_in=0 --occ_validation_policy=0" make crash_test -j ``` Parallel Validation (no share bucket) ``` export CRASH_TEST_EXT_ARGS="--use_optimistic_txn=1 --use_txn=1 --use_put_entity_one_in=0 --occ_validation_policy=1 --share_occ_lock_buckets=0" make crash_test -j ``` Parallel Validation (share bucket) ``` export CRASH_TEST_EXT_ARGS="--use_optimistic_txn=1 --use_txn=1 --use_put_entity_one_in=0 --occ_validation_policy=1 --share_occ_lock_buckets=1 --occ_lock_bucket_count=500" make crash_test -j ``` **Stress Test** ``` ./db_stress -use_optimistic_txn -threads=32 ``` Reviewed By: pdillinger Differential Revision: D46547387 Pulled By: jaykorean fbshipit-source-id: ca19819ca6e0281694966998014b40d95d4e5960
122 lines
4.7 KiB
Makefile
122 lines
4.7 KiB
Makefile
# This file is used by Meta-internal infrastructure as well as by Makefile
|
|
|
|
# When included from Makefile, there are rules to build DB_STRESS_CMD. When
|
|
# used directly with `make -f crashtest.mk ...` there will be no rules to
|
|
# build DB_STRESS_CMD so it must exist prior.
|
|
DB_STRESS_CMD?=./db_stress
|
|
|
|
include common.mk
|
|
|
|
CRASHTEST_MAKE=$(MAKE) -f crash_test.mk
|
|
CRASHTEST_PY=$(PYTHON) -u tools/db_crashtest.py --stress_cmd=$(DB_STRESS_CMD) --cleanup_cmd='$(DB_CLEANUP_CMD)'
|
|
|
|
.PHONY: crash_test crash_test_with_atomic_flush crash_test_with_txn \
|
|
crash_test_with_best_efforts_recovery crash_test_with_ts \
|
|
blackbox_crash_test blackbox_crash_test_with_atomic_flush \
|
|
blackbox_crash_test_with_txn blackbox_crash_test_with_ts \
|
|
blackbox_crash_test_with_best_efforts_recovery \
|
|
whitebox_crash_test whitebox_crash_test_with_atomic_flush \
|
|
whitebox_crash_test_with_txn whitebox_crash_test_with_ts \
|
|
blackbox_crash_test_with_multiops_wc_txn \
|
|
blackbox_crash_test_with_multiops_wp_txn \
|
|
crash_test_with_tiered_storage blackbox_crash_test_with_tiered_storage \
|
|
whitebox_crash_test_with_tiered_storage \
|
|
whitebox_crash_test_with_optimistic_txn \
|
|
blackbox_crash_test_with_optimistic_txn \
|
|
|
|
crash_test: $(DB_STRESS_CMD)
|
|
# Do not parallelize
|
|
$(CRASHTEST_MAKE) whitebox_crash_test
|
|
$(CRASHTEST_MAKE) blackbox_crash_test
|
|
|
|
crash_test_with_atomic_flush: $(DB_STRESS_CMD)
|
|
# Do not parallelize
|
|
$(CRASHTEST_MAKE) whitebox_crash_test_with_atomic_flush
|
|
$(CRASHTEST_MAKE) blackbox_crash_test_with_atomic_flush
|
|
|
|
crash_test_with_txn: $(DB_STRESS_CMD)
|
|
# Do not parallelize
|
|
$(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
|
|
$(CRASHTEST_MAKE) whitebox_crash_test_with_optimistic_txn
|
|
$(CRASHTEST_MAKE) blackbox_crash_test_with_optimistic_txn
|
|
|
|
crash_test_with_best_efforts_recovery: blackbox_crash_test_with_best_efforts_recovery
|
|
|
|
crash_test_with_ts: $(DB_STRESS_CMD)
|
|
# Do not parallelize
|
|
$(CRASHTEST_MAKE) whitebox_crash_test_with_ts
|
|
$(CRASHTEST_MAKE) blackbox_crash_test_with_ts
|
|
|
|
crash_test_with_tiered_storage: $(DB_STRESS_CMD)
|
|
# Do not parallelize
|
|
$(CRASHTEST_MAKE) whitebox_crash_test_with_tiered_storage
|
|
$(CRASHTEST_MAKE) blackbox_crash_test_with_tiered_storage
|
|
|
|
crash_test_with_multiops_wc_txn: $(DB_STRESS_CMD)
|
|
$(CRASHTEST_MAKE) blackbox_crash_test_with_multiops_wc_txn
|
|
|
|
crash_test_with_multiops_wp_txn: $(DB_STRESS_CMD)
|
|
$(CRASHTEST_MAKE) blackbox_crash_test_with_multiops_wp_txn
|
|
|
|
blackbox_crash_test: $(DB_STRESS_CMD)
|
|
$(CRASHTEST_PY) --simple blackbox $(CRASH_TEST_EXT_ARGS)
|
|
$(CRASHTEST_PY) blackbox $(CRASH_TEST_EXT_ARGS)
|
|
|
|
blackbox_crash_test_with_atomic_flush: $(DB_STRESS_CMD)
|
|
$(CRASHTEST_PY) --cf_consistency blackbox $(CRASH_TEST_EXT_ARGS)
|
|
|
|
blackbox_crash_test_with_txn: $(DB_STRESS_CMD)
|
|
$(CRASHTEST_PY) --txn blackbox $(CRASH_TEST_EXT_ARGS)
|
|
|
|
blackbox_crash_test_with_best_efforts_recovery: $(DB_STRESS_CMD)
|
|
$(CRASHTEST_PY) --test_best_efforts_recovery blackbox $(CRASH_TEST_EXT_ARGS)
|
|
|
|
blackbox_crash_test_with_ts: $(DB_STRESS_CMD)
|
|
$(CRASHTEST_PY) --enable_ts blackbox $(CRASH_TEST_EXT_ARGS)
|
|
|
|
blackbox_crash_test_with_multiops_wc_txn: $(DB_STRESS_CMD)
|
|
$(CRASHTEST_PY) --test_multiops_txn --write_policy write_committed blackbox $(CRASH_TEST_EXT_ARGS)
|
|
|
|
blackbox_crash_test_with_multiops_wp_txn: $(DB_STRESS_CMD)
|
|
$(CRASHTEST_PY) --test_multiops_txn --write_policy write_prepared blackbox $(CRASH_TEST_EXT_ARGS)
|
|
|
|
blackbox_crash_test_with_tiered_storage: $(DB_STRESS_CMD)
|
|
$(CRASHTEST_PY) --test_tiered_storage blackbox $(CRASH_TEST_EXT_ARGS)
|
|
|
|
blackbox_crash_test_with_optimistic_txn: $(DB_STRESS_CMD)
|
|
$(CRASHTEST_PY) --optimistic_txn blackbox $(CRASH_TEST_EXT_ARGS)
|
|
|
|
ifeq ($(CRASH_TEST_KILL_ODD),)
|
|
CRASH_TEST_KILL_ODD=888887
|
|
endif
|
|
|
|
whitebox_crash_test: $(DB_STRESS_CMD)
|
|
$(CRASHTEST_PY) --simple whitebox --random_kill_odd \
|
|
$(CRASH_TEST_KILL_ODD) $(CRASH_TEST_EXT_ARGS)
|
|
$(CRASHTEST_PY) whitebox --random_kill_odd \
|
|
$(CRASH_TEST_KILL_ODD) $(CRASH_TEST_EXT_ARGS)
|
|
|
|
whitebox_crash_test_with_atomic_flush: $(DB_STRESS_CMD)
|
|
$(CRASHTEST_PY) --cf_consistency whitebox --random_kill_odd \
|
|
$(CRASH_TEST_KILL_ODD) $(CRASH_TEST_EXT_ARGS)
|
|
|
|
whitebox_crash_test_with_txn: $(DB_STRESS_CMD)
|
|
$(CRASHTEST_PY) --txn whitebox --random_kill_odd \
|
|
$(CRASH_TEST_KILL_ODD) $(CRASH_TEST_EXT_ARGS)
|
|
|
|
whitebox_crash_test_with_ts: $(DB_STRESS_CMD)
|
|
$(CRASHTEST_PY) --enable_ts whitebox --random_kill_odd \
|
|
$(CRASH_TEST_KILL_ODD) $(CRASH_TEST_EXT_ARGS)
|
|
|
|
whitebox_crash_test_with_tiered_storage: $(DB_STRESS_CMD)
|
|
$(CRASHTEST_PY) --test_tiered_storage whitebox --random_kill_odd \
|
|
$(CRASH_TEST_KILL_ODD) $(CRASH_TEST_EXT_ARGS)
|
|
|
|
whitebox_crash_test_with_optimistic_txn: $(DB_STRESS_CMD)
|
|
$(CRASHTEST_PY) --optimistic_txn whitebox --random_kill_odd \
|
|
$(CRASH_TEST_KILL_ODD) $(CRASH_TEST_EXT_ARGS)
|