From a0200315525fbca26b7f11246ec3ab841241b05a Mon Sep 17 00:00:00 2001 From: Jay Zhuang Date: Thu, 2 Jun 2022 13:10:49 -0700 Subject: [PATCH] Add kLastTemperature as temperature high bound (#10044) Summary: Only used as temperature high bound for current code, may increase with more temperatures added. Pull Request resolved: https://github.com/facebook/rocksdb/pull/10044 Test Plan: ci Reviewed By: siying Differential Revision: D36633410 Pulled By: jay-zhuang fbshipit-source-id: eecdfa7623c31778c31d789902eacf78aad7b482 --- db/db_test2.cc | 5 +++++ include/rocksdb/advanced_options.h | 1 + 2 files changed, 6 insertions(+) diff --git a/db/db_test2.cc b/db/db_test2.cc index 34fc58967..52bc1a78d 100644 --- a/db/db_test2.cc +++ b/db/db_test2.cc @@ -6883,6 +6883,11 @@ TEST_F(DBTest2, BottommostTemperatureUniversal) { ASSERT_EQ(size, 0); size = GetSstSizeHelper(Temperature::kCold); ASSERT_GT(size, 0); + + // kLastTemperature is an invalid temperature + options.bottommost_temperature = Temperature::kLastTemperature; + s = TryReopen(options); + ASSERT_TRUE(s.IsIOError()); } TEST_F(DBTest2, LastLevelStatistics) { diff --git a/include/rocksdb/advanced_options.h b/include/rocksdb/advanced_options.h index 313f28992..e1b3aabd8 100644 --- a/include/rocksdb/advanced_options.h +++ b/include/rocksdb/advanced_options.h @@ -223,6 +223,7 @@ enum class Temperature : uint8_t { kHot = 0x04, kWarm = 0x08, kCold = 0x0C, + kLastTemperature, }; // The control option of how the cache tiers will be used. Currently rocksdb