Skip to content

Commit

Permalink
Delete local sv when destroying DB from stress test
Browse files Browse the repository at this point in the history
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
  • Loading branch information
igorcanadi committed Mar 7, 2014
1 parent 566f18e commit eec8695
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions db/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,15 @@ void DBImpl::TEST_Destroy_DBImpl() {
bg_logstats_scheduled_) {
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) {
bool is_last_reference __attribute__((unused));
is_last_reference = super_version_->Unref();
Expand Down

0 comments on commit eec8695

Please sign in to comment.