From f6a257b6a1ebd3dc0e803226919a47c2dd348f0c Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Fri, 28 Feb 2014 11:49:32 -0800 Subject: [PATCH] Set dropped column family before persisting in the manifest --- db/db_impl.cc | 2 +- db/version_set.cc | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/db/db_impl.cc b/db/db_impl.cc index e6c5ffed0..38426218c 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -3098,10 +3098,10 @@ Status DBImpl::DropColumnFamily(ColumnFamilyHandle* column_family) { s = Status::InvalidArgument("Column family already dropped!\n"); } if (s.ok()) { + cfd->SetDropped(); s = versions_->LogAndApply(cfd, &edit, &mutex_); } if (s.ok()) { - cfd->SetDropped(); // DB is holding one reference to each column family when it's alive, // need to drop it now if (cfd->Unref()) { diff --git a/db/version_set.cc b/db/version_set.cc index 76d53b6d8..44d8db983 100644 --- a/db/version_set.cc +++ b/db/version_set.cc @@ -1489,8 +1489,9 @@ Status VersionSet::LogAndApply(ColumnFamilyData* column_family_data, bool new_descriptor_log) { mu->AssertHeld(); - if (column_family_data->IsDropped()) { - // no need to write anything to the manifest + if (column_family_data->IsDropped() && !edit->is_column_family_drop_) { + // if column family is dropped no need to write anything to the manifest + // (unless, of course, thit is the drop column family write) return Status::OK(); }