Skip to content

Commit

Permalink
Make blob related VersionEdit tags unignorable (facebook#7886)
Browse files Browse the repository at this point in the history
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: facebook#7886

Test Plan: `make check`

Reviewed By: cheng-chang

Differential Revision: D25980956

Pulled By: ltamasi

fbshipit-source-id: 13cf5bd61d77f049b513ecd5ad0be8c637e40a9d
  • Loading branch information
ltamasi authored and facebook-github-bot committed Jan 21, 2021
1 parent b0c43e7 commit 2d37830
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions db/version_edit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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()) {
Expand Down
7 changes: 5 additions & 2 deletions db/version_edit.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2d37830

Please sign in to comment.