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
main
Levi Tamasi 4 years ago committed by Facebook GitHub Bot
parent b0c43e7081
commit 2d37830e44
  1. 6
      db/version_edit.cc
  2. 7
      db/version_edit.h

@ -556,7 +556,8 @@ Status VersionEdit::DecodeFrom(const Slice& src) {
break; break;
} }
case kBlobFileAddition: { case kBlobFileAddition:
case kBlobFileAddition_DEPRECATED: {
BlobFileAddition blob_file_addition; BlobFileAddition blob_file_addition;
const Status s = blob_file_addition.DecodeFrom(&input); const Status s = blob_file_addition.DecodeFrom(&input);
if (!s.ok()) { if (!s.ok()) {
@ -567,7 +568,8 @@ Status VersionEdit::DecodeFrom(const Slice& src) {
break; break;
} }
case kBlobFileGarbage: { case kBlobFileGarbage:
case kBlobFileGarbage_DEPRECATED: {
BlobFileGarbage blob_file_garbage; BlobFileGarbage blob_file_garbage;
const Status s = blob_file_garbage.DecodeFrom(&input); const Status s = blob_file_garbage.DecodeFrom(&input);
if (!s.ok()) { if (!s.ok()) {

@ -52,13 +52,16 @@ enum Tag : uint32_t {
kInAtomicGroup = 300, kInAtomicGroup = 300,
kBlobFileAddition = 400,
kBlobFileGarbage,
// Mask for an unidentified tag from the future which can be safely ignored. // Mask for an unidentified tag from the future which can be safely ignored.
kTagSafeIgnoreMask = 1 << 13, kTagSafeIgnoreMask = 1 << 13,
// Forward compatible (aka ignorable) records // Forward compatible (aka ignorable) records
kDbId, kDbId,
kBlobFileAddition, kBlobFileAddition_DEPRECATED,
kBlobFileGarbage, kBlobFileGarbage_DEPRECATED,
kWalAddition, kWalAddition,
kWalDeletion, kWalDeletion,
kFullHistoryTsLow, kFullHistoryTsLow,

Loading…
Cancel
Save