From: Sage Weil Date: Thu, 25 Jul 2019 14:02:04 +0000 (-0500) Subject: os/bluestore: ondisk format change to 3 for per-pool omap X-Git-Tag: v15.1.0~1915^2~9 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3cab0b3b09ac1b96ed9ef209ce5c6c8cdd014298;p=ceph-ci.git os/bluestore: ondisk format change to 3 for per-pool omap 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 --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 1b0f248434d..a0ac33fad2e 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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; diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 69278dd5d9d..18847f5a213 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -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