From 66ca5ac42744a5f240c56b675c4b590c538b3bd4 Mon Sep 17 00:00:00 2001 From: Jay Zhuang Date: Tue, 20 Jul 2021 14:58:19 -0700 Subject: [PATCH] Cleanup cf handlers before deleting db (#8564) Summary: Delete column family handlers before deleting db to avoid `last_ref` assert. Pull Request resolved: https://github.com/facebook/rocksdb/pull/8564 Test Plan: Inject compaction test in db_stress test Reviewed By: pdillinger Differential Revision: D29797375 Pulled By: jay-zhuang fbshipit-source-id: e8baf4d279f4db5d963db95c9445454156205501 --- db_stress_tool/db_stress_test_base.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/db_stress_tool/db_stress_test_base.cc b/db_stress_tool/db_stress_test_base.cc index f42d92438..777b95813 100644 --- a/db_stress_tool/db_stress_test_base.cc +++ b/db_stress_tool/db_stress_test_base.cc @@ -2563,7 +2563,12 @@ void StressTest::Open() { s = static_cast_with_check(db_->GetRootDB()) ->TEST_WaitForCompact(true); if (!s.ok()) { + for (auto cf : column_families_) { + delete cf; + } + column_families_.clear(); delete db_; + db_ = nullptr; } } if (!s.ok()) {