From db67c6a51ce6967068c9d67ba1b7512e3dd95b9f Mon Sep 17 00:00:00 2001 From: Yang Zhang Date: Mon, 30 Sep 2024 01:51:20 -0700 Subject: [PATCH] Prevent Titan panicing Signed-off-by: Yang Zhang --- db/dbformat.cc | 4 +++- db/dbformat.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/db/dbformat.cc b/db/dbformat.cc index 63bb354de87a..eaf7f9a32163 100644 --- a/db/dbformat.cc +++ b/db/dbformat.cc @@ -26,7 +26,7 @@ namespace ROCKSDB_NAMESPACE { // and the value type is embedded as the low 8 bits in the sequence // number in internal keys, we need to use the highest-numbered // ValueType, not the lowest). -const ValueType kValueTypeForSeek = kTypeWideColumnEntity; +const ValueType kValueTypeForSeek = kTypeBlobIndex; const ValueType kValueTypeForSeekForPrev = kTypeDeletion; const std::string kDisableUserTimestamp(""); @@ -48,6 +48,8 @@ EntryType GetEntryType(ValueType value_type) { return kEntryBlobIndex; case kTypeWideColumnEntity: return kEntryWideColumnEntity; + case kTypeTitanBlobIndex: + return kEntryBlobIndex; default: return kEntryOther; } diff --git a/db/dbformat.h b/db/dbformat.h index 981866c09dc5..ab632a229e37 100644 --- a/db/dbformat.h +++ b/db/dbformat.h @@ -54,7 +54,7 @@ enum ValueType : unsigned char { kTypeColumnFamilyRangeDeletion = 0xE, // WAL only. kTypeRangeDeletion = 0xF, // meta block kTypeColumnFamilyBlobIndex = 0x10, // Blob DB only - kTypeBlobIndex = 0x11, // Blob DB only + kTypeTitanBlobIndex = 0x11, // Titan Blob DB only // When the prepared record is also persisted in db, we use a different // record. This is to ensure that the WAL that is generated by a WritePolicy // is not mistakenly read by another, which would result into data @@ -68,6 +68,7 @@ enum ValueType : unsigned char { kTypeCommitXIDAndTimestamp = 0x15, // WAL only kTypeWideColumnEntity = 0x16, kTypeColumnFamilyWideColumnEntity = 0x17, // WAL only + kTypeBlobIndex = 0x18, // RocksDB native Blob DB only kTypeMaxValid, // Should be after the last valid type, only used for // validation kMaxValue = 0x7F // Not used for storing records.