Skip to content

Commit f6a257b

Browse files
committed
Set dropped column family before persisting in the manifest
1 parent 670f3ba commit f6a257b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

db/db_impl.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3098,10 +3098,10 @@ Status DBImpl::DropColumnFamily(ColumnFamilyHandle* column_family) {
30983098
s = Status::InvalidArgument("Column family already dropped!\n");
30993099
}
31003100
if (s.ok()) {
3101+
cfd->SetDropped();
31013102
s = versions_->LogAndApply(cfd, &edit, &mutex_);
31023103
}
31033104
if (s.ok()) {
3104-
cfd->SetDropped();
31053105
// DB is holding one reference to each column family when it's alive,
31063106
// need to drop it now
31073107
if (cfd->Unref()) {

db/version_set.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -1489,8 +1489,9 @@ Status VersionSet::LogAndApply(ColumnFamilyData* column_family_data,
14891489
bool new_descriptor_log) {
14901490
mu->AssertHeld();
14911491

1492-
if (column_family_data->IsDropped()) {
1493-
// no need to write anything to the manifest
1492+
if (column_family_data->IsDropped() && !edit->is_column_family_drop_) {
1493+
// if column family is dropped no need to write anything to the manifest
1494+
// (unless, of course, thit is the drop column family write)
14941495
return Status::OK();
14951496
}
14961497

0 commit comments

Comments
 (0)