diff options
Diffstat (limited to 'src/osd/OSD.cc')
-rw-r--r-- | src/osd/OSD.cc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 7f9b601556f..2f4703e3068 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -135,7 +135,9 @@ static ostream& _prefix(std::ostream* _dout, int whoami, OSDMapRef osdmap) { const coll_t coll_t::META_COLL("meta"); -static CompatSet get_osd_compat_set() { +//Initial features in new superblock. +//Features here are also automatically upgraded +CompatSet OSD::get_osd_initial_compat_set() { CompatSet::FeatureSet ceph_osd_feature_compat; CompatSet::FeatureSet ceph_osd_feature_ro_compat; CompatSet::FeatureSet ceph_osd_feature_incompat; @@ -153,6 +155,13 @@ static CompatSet get_osd_compat_set() { ceph_osd_feature_incompat); } +//Features are added here that this OSD supports. +CompatSet OSD::get_osd_compat_set() { + CompatSet compat = get_osd_initial_compat_set(); + //Any features here can be set in code, but not in initial superblock + return compat; +} + OSDService::OSDService(OSD *osd) : osd(osd), whoami(osd->whoami), store(osd->store), clog(osd->clog), @@ -617,7 +626,7 @@ int OSD::mkfs(const std::string &dev, const std::string &jdev, uuid_d fsid, int sb.cluster_fsid = fsid; sb.osd_fsid = store->get_fsid(); sb.whoami = whoami; - sb.compat_features = get_osd_compat_set(); + sb.compat_features = get_osd_initial_compat_set(); // benchmark? if (g_conf->osd_auto_weight) { @@ -1153,11 +1162,12 @@ int OSD::init() return r; } - if (osd_compat.compare(superblock.compat_features) != 0) { + CompatSet initial = get_osd_initial_compat_set(); + if (initial.compare(superblock.compat_features) != 0) { // We need to persist the new compat_set before we // do anything else dout(5) << "Upgrading superblock compat_set" << dendl; - superblock.compat_features = osd_compat; + superblock.compat_features = initial; ObjectStore::Transaction t; write_superblock(t); r = store->apply_transaction(t); |