]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: permit legacy omap naming scheme in mkfs.
authorIgor Fedotov <ifedotov@suse.com>
Tue, 9 Feb 2021 15:37:41 +0000 (18:37 +0300)
committerIgor Fedotov <ifed@suse.com>
Wed, 3 Nov 2021 14:17:44 +0000 (17:17 +0300)
Primarily for debug purposes...

Signed-off-by: Igor Fedotov <ifedotov@suse.com>
(cherry picked from commit 99e40a1e87c44705ffdb557d57bd54eaff31cfe3)

 Conflicts:
src/common/options/global.yaml.in
 old way of specifying config settings

src/common/legacy_config_opts.h
src/common/options.cc
src/os/bluestore/BlueStore.cc

index f2610f33a709793f290f0b5974894777d756667c..ee49a0e37e54e5e89dbda6b63c398b555392da8f 100644 (file)
@@ -1036,6 +1036,7 @@ OPTION(bluestore_debug_fsck_abort, OPT_BOOL)
 OPTION(bluestore_debug_omit_kv_commit, OPT_BOOL)
 OPTION(bluestore_debug_permit_any_bdev_label, OPT_BOOL)
 OPTION(bluestore_debug_random_read_err, OPT_DOUBLE)
+OPTION(bluestore_debug_legacy_omap, OPT_BOOL)
 OPTION(bluestore_debug_inject_bug21040, OPT_BOOL)
 OPTION(bluestore_debug_inject_csum_err_probability, OPT_FLOAT)
 OPTION(bluestore_fsck_error_on_no_per_pool_stats, OPT_BOOL)
index 1a13982179eeec16df32f77225bc307344697c8b..c19a991a98d4bf6117d0806daa8901642d693f82 100644 (file)
@@ -4857,6 +4857,10 @@ std::vector<Option> get_global_options() {
     .set_default(0)
     .set_description(""),
 
+    Option("bluestore_debug_legacy_omap", Option::TYPE_BOOL, Option::LEVEL_DEV)
+    .set_default(false)
+    .set_description(""),
+
     Option("bluestore_debug_inject_bug21040", Option::TYPE_BOOL, Option::LEVEL_DEV)
     .set_default(false)
     .set_description(""),
index 232e44d949d92b5eb4fc4cd2bb1886e595da1d75..91d64b8fd95f40535fd438a90a11fd97d2ff2e51 100644 (file)
@@ -6255,9 +6255,10 @@ void BlueStore::_set_per_pool_omap()
     auto s = bl.to_str();
     if (s == stringify(OMAP_PER_POOL)) {
       per_pool_omap = OMAP_PER_POOL;
-    } else {
-      ceph_assert(s == stringify(OMAP_PER_PG));
+    } else if (s == stringify(OMAP_PER_PG)) {
       per_pool_omap = OMAP_PER_PG;
+    } else {
+      ceph_assert(s == stringify(OMAP_BULK));
     }
     dout(10) << __func__ << " per_pool_omap = " << per_pool_omap << dendl;
   } else {
@@ -6560,7 +6561,11 @@ int BlueStore::mkfs()
     }
     {
       bufferlist bl;
-      bl.append(stringify(OMAP_PER_PG));
+      if (cct->_conf.get_val<bool>("bluestore_debug_legacy_omap")) {
+       bl.append(stringify(OMAP_BULK));
+      } else {
+       bl.append(stringify(OMAP_PER_PG));
+      }
       t->set(PREFIX_SUPER, "per_pool_omap", bl);
     }
     ondisk_format = latest_ondisk_format;