]> 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>
Thu, 28 Oct 2021 12:58:48 +0000 (15:58 +0300)
Primarily for debug purposes...

Signed-off-by: Igor Fedotov <ifedotov@suse.com>
src/common/options/global.yaml.in
src/os/bluestore/BlueStore.cc

index 38b95313bc96da7543e08fa23c910532d4534530..ed529f18fe0b257d0188e0b4678b1d2aa637deb2 100644 (file)
@@ -5020,6 +5020,15 @@ options:
   desc: inject crc verification errors into bluestore device reads
   default: 0
   with_legacy: true
+- name: bluestore_debug_legacy_omap
+  type: bool
+  level: dev
+  desc: Allows mkfs to create OSD in legacy OMAP naming mode (neither per-pool nor per-pg).
+    This is intended primarily for developers' purposes. The resulting OSD might/would
+    be transformed to the currrently default 'per-pg' format when BlueStore's quick-fix or
+    repair are applied.
+  default: false
+  with_legacy: true
 - name: bluestore_fsck_error_on_no_per_pool_stats
   type: bool
   level: advanced
index 4f59ebde508a581df7ea6760aa220072a87b731e..e5d291b63803404e3625c2c1abd9bd0abf280d9f 100644 (file)
@@ -6410,9 +6410,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 {
@@ -6715,7 +6716,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;