diff --git a/HISTORY.md b/HISTORY.md index b71479621..1ccb15a1c 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -5,6 +5,7 @@ * Fixed two performance issues related to memtable history trimming. First, a new SuperVersion is now created only if some memtables were actually trimmed. Second, trimming is only scheduled if there is at least one flushed memtable that is kept in memory for the purposes of transaction conflict checking. * BlobDB no longer updates the SST to blob file mapping upon failed compactions. * Fix a bug in which a snapshot read through an iterator could be affected by a DeleteRange after the snapshot (#6062). +* Fixed a bug where BlobDB was comparing the `ColumnFamilyHandle` pointers themselves instead of only the column family IDs when checking whether an API call uses the default column family or not. ## 6.6.0 (11/25/2019) ### Bug Fixes diff --git a/utilities/blob_db/blob_db.h b/utilities/blob_db/blob_db.h index d6ebca2db..14ceabe23 100644 --- a/utilities/blob_db/blob_db.h +++ b/utilities/blob_db/blob_db.h @@ -87,7 +87,7 @@ class BlobDB : public StackableDB { virtual Status Put(const WriteOptions& options, ColumnFamilyHandle* column_family, const Slice& key, const Slice& value) override { - if (column_family != DefaultColumnFamily()) { + if (column_family->GetID() != DefaultColumnFamily()->GetID()) { return Status::NotSupported( "Blob DB doesn't support non-default column family."); } @@ -98,7 +98,7 @@ class BlobDB : public StackableDB { virtual Status Delete(const WriteOptions& options, ColumnFamilyHandle* column_family, const Slice& key) override { - if (column_family != DefaultColumnFamily()) { + if (column_family->GetID() != DefaultColumnFamily()->GetID()) { return Status::NotSupported( "Blob DB doesn't support non-default column family."); } @@ -111,7 +111,7 @@ class BlobDB : public StackableDB { virtual Status PutWithTTL(const WriteOptions& options, ColumnFamilyHandle* column_family, const Slice& key, const Slice& value, uint64_t ttl) { - if (column_family != DefaultColumnFamily()) { + if (column_family->GetID() != DefaultColumnFamily()->GetID()) { return Status::NotSupported( "Blob DB doesn't support non-default column family."); } @@ -125,7 +125,7 @@ class BlobDB : public StackableDB { virtual Status PutUntil(const WriteOptions& options, ColumnFamilyHandle* column_family, const Slice& key, const Slice& value, uint64_t expiration) { - if (column_family != DefaultColumnFamily()) { + if (column_family->GetID() != DefaultColumnFamily()->GetID()) { return Status::NotSupported( "Blob DB doesn't support non-default column family."); } @@ -157,7 +157,7 @@ class BlobDB : public StackableDB { const std::vector& keys, std::vector* values) override { for (auto column_family : column_families) { - if (column_family != DefaultColumnFamily()) { + if (column_family->GetID() != DefaultColumnFamily()->GetID()) { return std::vector( column_families.size(), Status::NotSupported( @@ -197,7 +197,7 @@ class BlobDB : public StackableDB { virtual Iterator* NewIterator(const ReadOptions& options) override = 0; virtual Iterator* NewIterator(const ReadOptions& options, ColumnFamilyHandle* column_family) override { - if (column_family != DefaultColumnFamily()) { + if (column_family->GetID() != DefaultColumnFamily()->GetID()) { // Blob DB doesn't support non-default column family. return nullptr; } @@ -217,7 +217,7 @@ class BlobDB : public StackableDB { const int output_path_id = -1, std::vector* const output_file_names = nullptr, CompactionJobInfo* compaction_job_info = nullptr) override { - if (column_family != DefaultColumnFamily()) { + if (column_family->GetID() != DefaultColumnFamily()->GetID()) { return Status::NotSupported( "Blob DB doesn't support non-default column family."); } diff --git a/utilities/blob_db/blob_db_impl.cc b/utilities/blob_db/blob_db_impl.cc index 0e10e647f..914a48c3b 100644 --- a/utilities/blob_db/blob_db_impl.cc +++ b/utilities/blob_db/blob_db_impl.cc @@ -1466,7 +1466,7 @@ Status BlobDBImpl::Get(const ReadOptions& read_options, Status BlobDBImpl::GetImpl(const ReadOptions& read_options, ColumnFamilyHandle* column_family, const Slice& key, PinnableSlice* value, uint64_t* expiration) { - if (column_family != DefaultColumnFamily()) { + if (column_family->GetID() != DefaultColumnFamily()->GetID()) { return Status::NotSupported( "Blob DB doesn't support non-default column family."); }