Blob DB: Fix GC handling for inlined blob

Summary:
Garbage collection checks if the offset in blob index matches the offset of the blob value in the file. If it is a mismatch, the value is the current version. However it failed to check if the blob index is an inlined type, which don't even have an offset. Fixing it.
Closes https://github.com/facebook/rocksdb/pull/3194

Differential Revision: D6394270

Pulled By: yiwu-arbug

fbshipit-source-id: 7c2b9d795f1116f55f4d728086980f9b6e88ea78
main
Yi Wu 7 years ago committed by Facebook Github Bot
parent e59cb2a19b
commit f0dde49cda
  1. 3
      utilities/blob_db/blob_db_impl.cc

@ -1738,7 +1738,8 @@ Status BlobDBImpl::GCFileAndUpdateLSM(const std::shared_ptr<BlobFile>& bfptr,
s.ToString().c_str());
break;
}
if (blob_index.file_number() != bfptr->BlobFileNumber() ||
if (blob_index.IsInlined() ||
blob_index.file_number() != bfptr->BlobFileNumber() ||
blob_index.offset() != blob_offset) {
// Key has been overwritten. Drop the blob record.
continue;

Loading…
Cancel
Save