mirror of https://github.com/facebook/rocksdb.git
Set dropped column family before persisting in the manifest
This commit is contained in:
parent
670f3ba212
commit
f6a257b6a1
|
@ -3098,10 +3098,10 @@ Status DBImpl::DropColumnFamily(ColumnFamilyHandle* column_family) {
|
||||||
s = Status::InvalidArgument("Column family already dropped!\n");
|
s = Status::InvalidArgument("Column family already dropped!\n");
|
||||||
}
|
}
|
||||||
if (s.ok()) {
|
if (s.ok()) {
|
||||||
|
cfd->SetDropped();
|
||||||
s = versions_->LogAndApply(cfd, &edit, &mutex_);
|
s = versions_->LogAndApply(cfd, &edit, &mutex_);
|
||||||
}
|
}
|
||||||
if (s.ok()) {
|
if (s.ok()) {
|
||||||
cfd->SetDropped();
|
|
||||||
// DB is holding one reference to each column family when it's alive,
|
// DB is holding one reference to each column family when it's alive,
|
||||||
// need to drop it now
|
// need to drop it now
|
||||||
if (cfd->Unref()) {
|
if (cfd->Unref()) {
|
||||||
|
|
|
@ -1489,8 +1489,9 @@ Status VersionSet::LogAndApply(ColumnFamilyData* column_family_data,
|
||||||
bool new_descriptor_log) {
|
bool new_descriptor_log) {
|
||||||
mu->AssertHeld();
|
mu->AssertHeld();
|
||||||
|
|
||||||
if (column_family_data->IsDropped()) {
|
if (column_family_data->IsDropped() && !edit->is_column_family_drop_) {
|
||||||
// no need to write anything to the manifest
|
// 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();
|
return Status::OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue