Delete local sv when destroying DB from stress test

Summary: Not deleting local SV caused some an crash test issue: http://ci-builds.fb.com/job/rocksdb_asan_crash_test/83/console

Test Plan: ran unit tests

Reviewers: ljin

Reviewed By: ljin

CC: leveldb

Differential Revision: https://reviews.facebook.net/D16635
main
Igor Canadi 11 years ago
parent 566f18e6ad
commit eec8695206
  1. 9
      db/db_impl.cc

@ -402,6 +402,15 @@ void DBImpl::TEST_Destroy_DBImpl() {
bg_logstats_scheduled_) { bg_logstats_scheduled_) {
bg_cv_.Wait(); bg_cv_.Wait();
} }
mutex_.Unlock();
// Release SuperVersion reference kept in ThreadLocalPtr.
// This must be done outside of mutex_ since unref handler can lock mutex.
// It also needs to be done after FlushMemTable, which can trigger local_sv_
// access.
delete local_sv_;
mutex_.Lock();
if (super_version_ != nullptr) { if (super_version_ != nullptr) {
bool is_last_reference __attribute__((unused)); bool is_last_reference __attribute__((unused));
is_last_reference = super_version_->Unref(); is_last_reference = super_version_->Unref();

Loading…
Cancel
Save