Skip to content

Commit

Permalink
Cleanup multiple DBs after running db_bench in multi-DB mode (faceboo…
Browse files Browse the repository at this point in the history
…k#7891)

Summary:
Currently, db_bench cleanup only deletes the main DB, if there's one.
Multiple DBs that are opened when --num_multi_db is specified are not
deleted, which can lead to crashes due to running compaction threads on
process exit.

Pull Request resolved: facebook#7891

Test Plan: Run regression test

Reviewed By: jay-zhuang

Differential Revision: D26049914

Pulled By: anand1976

fbshipit-source-id: acef2821001ca5e208a96a6a273c724e56353316
  • Loading branch information
anand76 authored and codingrhythm committed Mar 5, 2021
1 parent 77887d7 commit 83a0021
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/db_bench_tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2784,6 +2784,9 @@ class Benchmark {

~Benchmark() {
db_.DeleteDBs();
for (auto db : multi_dbs_) {
db.DeleteDBs();
}
delete prefix_extractor_;
if (cache_.get() != nullptr) {
// this will leak, but we're shutting down so nobody cares
Expand Down

0 comments on commit 83a0021

Please sign in to comment.