]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: record require_osd_release in objectstore meta
authorSage Weil <sage@redhat.com>
Mon, 28 Jan 2019 21:05:53 +0000 (15:05 -0600)
committerSage Weil <sage@redhat.com>
Mon, 28 Jan 2019 21:15:51 +0000 (15:15 -0600)
Record the require_osd_release value from the OSDMap in the 'meta' portion
of the osd's metadata that can be accessed without actually mounting the
OSD.  This will be useful as a safety gate to prevent you from mounting
an osd thet is too new that may make incompatible changes to the store.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc
src/osd/OSD.h

index 0444aab500a8fd8db0c969f691561611e469eef2..4c6da0e5dd54af3e17750ca3f92a4e7c00e43a7e 100644 (file)
@@ -2805,6 +2805,12 @@ int OSD::init()
 
   boot_finisher.start();
 
+  {
+    string val;
+    store->read_meta("require_osd_release", &val);
+    last_require_osd_release = atoi(val.c_str());
+  }
+
   // mount.
   dout(2) << "init " << dev_path
          << " (looks like " << (store_is_rotational ? "hdd" : "ssd") << ")"
@@ -8327,6 +8333,13 @@ void OSD::check_osdmap_features()
   if (osdmap->require_osd_release < CEPH_RELEASE_NAUTILUS) {
     heartbeat_dispatcher.ms_set_require_authorizer(false);
   }
+
+  if (osdmap->require_osd_release != last_require_osd_release) {
+    dout(1) << __func__ << " require_osd_release " << last_require_osd_release
+           << " -> " << osdmap->require_osd_release << dendl;
+    store->write_meta("require_osd_release", stringify(osdmap->require_osd_release));
+    last_require_osd_release = osdmap->require_osd_release;
+  }
 }
 
 struct C_FinishSplits : public Context {
index ee5302950f8b040a9699837c42efea777c3a21cc..e83bcd68eb99c6efd50c1f12e826246027148b1b 100644 (file)
@@ -1298,6 +1298,8 @@ protected:
   int whoami;
   std::string dev_path, journal_path;
 
+  int last_require_osd_release = 0;
+
   int numa_node = -1;
   size_t numa_cpu_set_size = 0;
   cpu_set_t numa_cpu_set;