From 8438a19360861070a3d5a86d0162c6160495618f Mon Sep 17 00:00:00 2001 From: Feng Zhu Date: Tue, 2 Sep 2014 12:25:58 -0700 Subject: [PATCH] fix dropping column family bug Summary: 1. db/db_impl.cc:2324 (DBImpl::BackgroundCompaction) should not raise bg_error_ when column family is dropped during compaction. Test Plan: 1. db_stress Reviewers: ljin, yhchiang, dhruba, igor, sdong Reviewed By: igor Subscribers: leveldb Differential Revision: https://reviews.facebook.net/D22653 --- db/db_impl.cc | 2 +- include/rocksdb/status.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db/db_impl.cc b/db/db_impl.cc index 9900ff2bb..f41d1d05d 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -2321,7 +2321,7 @@ Status DBImpl::BackgroundCompaction(bool* madeProgress, if (status.ok()) { // Done - } else if (shutting_down_.Acquire_Load()) { + } else if (status.IsShutdownInProgress()) { // Ignore compaction errors found during shutting down } else { Log(InfoLogLevel::WARN_LEVEL, options_.info_log, "Compaction error: %s", diff --git a/include/rocksdb/status.h b/include/rocksdb/status.h index b20689a77..d13ff9d81 100644 --- a/include/rocksdb/status.h +++ b/include/rocksdb/status.h @@ -96,7 +96,7 @@ class Status { // Returns true iff the status indicates Incomplete bool IsIncomplete() const { return code() == kIncomplete; } - // Returns true iff the status indicates Incomplete + // Returns true iff the status indicates Shutdown In progress bool IsShutdownInProgress() const { return code() == kShutdownInProgress; } bool IsTimedOut() const { return code() == kTimedOut; }