1
0
mirror of https://github.com/facebook/rocksdb.git synced 2026-10-23 08:09:02 +03:00

Enable SecondaryDB in CF-consistency crash tests (#15270)

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

D121318547 added SecondaryDB batch-iterator coverage to CfConsistencyStressTest::ContinuouslyVerifyDb(), but the automated CF-consistency crash-test profile never selected test_secondary. Automated runs therefore exercised only the primary DB path while the targeted manual validation used test_secondary=true.

Randomize test_secondary between 0 and 1 in cf_consistency_params. Each generated run can now exercise either the existing primary-only path or the SecondaryDB path, preserving both configurations in the continuous matrix. The regression test deterministically verifies both random outcomes. Existing sanitization may still disable SecondaryDB when another selected option is incompatible, such as remote compaction or primary UDI mode.

Reviewed By: xingbowang

Differential Revision: D121813002

fbshipit-source-id: 4080e2131c1f063d590d24cc0bcee9b9096de63a
This commit is contained in:
Jay Huh
2026-09-25 16:27:49 -07:00
committed by meta-codesync[bot]
parent ac30c4d738
commit 4052fccde9
2 changed files with 12 additions and 0 deletions

View File

@@ -967,6 +967,7 @@ cf_consistency_params = {
"disable_wal": lambda: random.randint(0, 1),
"reopen": 0,
"test_cf_consistency": 1,
"test_secondary": lambda: random.randint(0, 1),
# use small value for write_buffer_size so that RocksDB triggers flush
# more frequently
"write_buffer_size": 1024 * 1024,

View File

@@ -345,6 +345,17 @@ class DBCrashTestTest(unittest.TestCase):
command,
)
def test_cf_consistency_randomizes_secondary(self):
db_crashtest = self.load_db_crashtest()
params = db_crashtest.gen_cmd_params(
self.build_mode_args("blackbox", cf_consistency=True)
)
with mock.patch.object(db_crashtest.random, "randint", side_effect=[0, 1]):
self.assertEqual(0, params["test_secondary"]())
self.assertEqual(1, params["test_secondary"]())
def test_skip_verifydb_disables_verification_knobs(self):
db_crashtest = self.load_db_crashtest()