From 2d37830e44e015503ec6d553e2a3b651ddbc3c44 Mon Sep 17 00:00:00 2001 From: Levi Tamasi Date: Wed, 20 Jan 2021 20:27:19 -0800 Subject: [PATCH] Make blob related VersionEdit tags unignorable (#7886) Summary: BlobFileAddition and BlobFileGarbage should not be in the ignorable tag range, since if they are present in the MANIFEST, users cannot downgrade to a RocksDB version that does not understand them without losing access to the data in the blob files. The patch moves these two tags to the unignorable range; this should still be safe at this point, since the integrated BlobDB project is still work in progress and thus there shouldn't be any ignorable BlobFileAddition/BlobFileGarbage tags out there. Pull Request resolved: https://github.com/facebook/rocksdb/pull/7886 Test Plan: `make check` Reviewed By: cheng-chang Differential Revision: D25980956 Pulled By: ltamasi fbshipit-source-id: 13cf5bd61d77f049b513ecd5ad0be8c637e40a9d --- db/version_edit.cc | 6 ++++-- db/version_edit.h | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/db/version_edit.cc b/db/version_edit.cc index 284b65f71..d9246367c 100644 --- a/db/version_edit.cc +++ b/db/version_edit.cc @@ -556,7 +556,8 @@ Status VersionEdit::DecodeFrom(const Slice& src) { break; } - case kBlobFileAddition: { + case kBlobFileAddition: + case kBlobFileAddition_DEPRECATED: { BlobFileAddition blob_file_addition; const Status s = blob_file_addition.DecodeFrom(&input); if (!s.ok()) { @@ -567,7 +568,8 @@ Status VersionEdit::DecodeFrom(const Slice& src) { break; } - case kBlobFileGarbage: { + case kBlobFileGarbage: + case kBlobFileGarbage_DEPRECATED: { BlobFileGarbage blob_file_garbage; const Status s = blob_file_garbage.DecodeFrom(&input); if (!s.ok()) { diff --git a/db/version_edit.h b/db/version_edit.h index a80543a0d..02fee7fcf 100644 --- a/db/version_edit.h +++ b/db/version_edit.h @@ -52,13 +52,16 @@ enum Tag : uint32_t { kInAtomicGroup = 300, + kBlobFileAddition = 400, + kBlobFileGarbage, + // Mask for an unidentified tag from the future which can be safely ignored. kTagSafeIgnoreMask = 1 << 13, // Forward compatible (aka ignorable) records kDbId, - kBlobFileAddition, - kBlobFileGarbage, + kBlobFileAddition_DEPRECATED, + kBlobFileGarbage_DEPRECATED, kWalAddition, kWalDeletion, kFullHistoryTsLow,