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
main
Jay Zhuang 3 years ago committed by Facebook GitHub Bot
parent bbc85a5f22
commit 66ca5ac427
  1. 5
      db_stress_tool/db_stress_test_base.cc

@ -2563,7 +2563,12 @@ void StressTest::Open() {
s = static_cast_with_check<DBImpl>(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()) {

Loading…
Cancel
Save