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>
(cherry picked from commit
482cdca55351ca85290f1b2adb3c0cdf78af411d)
Conflicts:
src/osd/OSD.cc
src/osd/OSD.h
- ignore differences in surrounding context, as they do not seem relevant to
the fix
service.recovery_request_timer.init();
service.recovery_sleep_timer.init();
+ {
+ 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") << ")"
assert(err == 0);
}
}
+
+ 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;
+ }
}
bool OSD::advance_pg(
int whoami;
std::string dev_path, journal_path;
+ int last_require_osd_release = 0;
+
bool store_is_rotational = true;
bool journal_is_rotational = true;