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
This commit is contained in:
Yi Wu 2017-11-24 11:50:42 -08:00
parent 3984b44095
commit 9debbba3a5

View File

@ -1737,7 +1737,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;