]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: ondisk format change to 3 for per-pool omap
authorSage Weil <sage@redhat.com>
Thu, 25 Jul 2019 14:02:04 +0000 (09:02 -0500)
committerSage Weil <sage@redhat.com>
Tue, 6 Aug 2019 14:24:14 +0000 (09:24 -0500)
Move to ondisk format v3.  This means that per-pool omap keys may exist,
but does not imply that *all* objects use the new form until the
per_pool_omap=1 super key is also set.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index 1b0f248434d1050a73c6b6920d6bae2882a46a89..a0ac33fad2e6813eed5b92bf9f49e6529c961681 100644 (file)
@@ -9906,6 +9906,19 @@ int BlueStore::_upgrade_super()
       int r = db->submit_transaction_sync(t);
       ceph_assert(r == 0);
     }
+    if (ondisk_format == 2) {
+      // changes:
+      // - onode has FLAG_PER_POOL_OMAP.  Note that we do not know that *all*
+      //   ondes are using the per-pool prefix until a repair is run; at that
+      //   point the per_pool_omap=1 key will be set.
+      // - super: added per_pool_omap key, which indicates that *all* objects
+      //   are using the new prefix and key format
+      ondisk_format = 3;
+      KeyValueDB::Transaction t = db->get_transaction();
+      _prepare_ondisk_format_super(t);
+      int r = db->submit_transaction_sync(t);
+      ceph_assert(r == 0);
+    }
   }
   // done
   dout(1) << __func__ << " done" << dendl;
index 69278dd5d9df73a19487f1d573d6f54ebfe9304c..18847f5a213617b223657da89185c24cc1af47a7 100644 (file)
@@ -2232,9 +2232,9 @@ private:
 
   // -- ondisk version ---
 public:
-  const int32_t latest_ondisk_format = 2;        ///< our version
+  const int32_t latest_ondisk_format = 3;        ///< our version
   const int32_t min_readable_ondisk_format = 1;  ///< what we can read
-  const int32_t min_compat_ondisk_format = 2;    ///< who can read us
+  const int32_t min_compat_ondisk_format = 3;    ///< who can read us
 
 private:
   int32_t ondisk_format = 0;  ///< value detected on mount