From f0dde49cda71f61ccf36f3fc19428cc9bf930e13 Mon Sep 17 00:00:00 2001 From: Yi Wu Date: Fri, 24 Nov 2017 11:50:42 -0800 Subject: [PATCH] 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 --- utilities/blob_db/blob_db_impl.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utilities/blob_db/blob_db_impl.cc b/utilities/blob_db/blob_db_impl.cc index 7cdf5c31a..98dbd35fe 100644 --- a/utilities/blob_db/blob_db_impl.cc +++ b/utilities/blob_db/blob_db_impl.cc @@ -1738,7 +1738,8 @@ Status BlobDBImpl::GCFileAndUpdateLSM(const std::shared_ptr& 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;