]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
kv/RocksDBStore: Using stored sharding if provided is empty
authorAdam Kupczyk <akupczyk@redhat.com>
Wed, 1 Apr 2020 12:52:22 +0000 (14:52 +0200)
committerAdam Kupczyk <akupczyk@redhat.com>
Fri, 17 Apr 2020 06:55:54 +0000 (08:55 +0200)
This change is needed for cases when tools cannot know and don't care about sharding.

Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
src/kv/RocksDBStore.cc

index fa16bdc18ca848f13497f5d7ae091bc35a145568..a47b51fa93fa374beafda12af9ba2cc1ddca1fc3 100644 (file)
@@ -760,7 +760,13 @@ int RocksDBStore::verify_sharding(const rocksdb::Options& opt,
   //check if sharding_def matches stored_sharding_def
   std::vector<ColumnFamily> sharding_def;
   std::vector<ColumnFamily> stored_sharding_def;
-  parse_sharding_def(sharding_text, sharding_def);
+  if (!sharding_text.empty()) {
+    parse_sharding_def(sharding_text, sharding_def);
+  } else {
+    //if sharding requested is empty, assume that it agrees with stored
+    //this is necessary for ceph-bluestore-tool fsck
+    parse_sharding_def(stored_sharding_text, sharding_def);
+  }
   parse_sharding_def(stored_sharding_text, stored_sharding_def);
 
   std::sort(sharding_def.begin(), sharding_def.end(),