]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Add kLastTemperature as temperature high bound (#10044)
authorJay Zhuang <zjay@fb.com>
Thu, 2 Jun 2022 20:10:49 +0000 (13:10 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 2 Jun 2022 20:10:49 +0000 (13:10 -0700)
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
include/rocksdb/advanced_options.h

index 34fc589671c823a31e9e7b770e6f7e7d9dd37b07..52bc1a78dd75af8ffdf038a88c530d45be44f26c 100644 (file)
@@ -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) {
index 313f289922ecb5b815f0e7eac87ad774d4837ba3..e1b3aabd80e87e7898f35b303a996e84038b9451 100644 (file)
@@ -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