From 36174d89a6000723f3ad6bdb3d25f64866cab0f2 Mon Sep 17 00:00:00 2001 From: sdong Date: Mon, 30 Jan 2023 19:45:47 -0800 Subject: [PATCH] DB Stress to fix a false assertion (#11164) Summary: Seeting this error in stress test: db_stress: internal_repo_rocksdb/repo/db_stress_tool/db_stress_test_base.cc:2459: void rocksdb::StressTest::Open(rocksdb::SharedState *): Assertion `txn_db_ == nullptr' failed. Received signal 6 (Aborted) ...... It doesn't appear that txn_db_ is set to nullptr at all. We set ithere. Pull Request resolved: https://github.com/facebook/rocksdb/pull/11164 Test Plan: Run db_stress transaction and non-transation with low kill rate and see restarting without assertion Reviewed By: ajkr Differential Revision: D42855662 fbshipit-source-id: 06816d37cce9c94a81cb54ab238fb73aa102ed46 --- db_stress_tool/db_stress_test_base.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db_stress_tool/db_stress_test_base.cc b/db_stress_tool/db_stress_test_base.cc index 2ec759586..a1d9b08b0 100644 --- a/db_stress_tool/db_stress_test_base.cc +++ b/db_stress_tool/db_stress_test_base.cc @@ -2792,8 +2792,10 @@ void StressTest::Reopen(ThreadState* thread) { } assert(s.ok()); } + assert(txn_db_ == nullptr || db_ == txn_db_); delete db_; db_ = nullptr; + txn_db_ = nullptr; num_times_reopened_++; auto now = clock_->NowMicros();