bufferlist features;
store.get_bl_ss(features, COMPAT_SET_LOC, 0);
if (features.length() == 0) {
- cerr << "mon fs missing feature list. Exiting now" << std::endl;
- exit(1);
+ cerr << "WARNING: mon fs missing feature list.\n"
+ << "Assuming it is old-style and introducing one." << std::endl;
+ //we only want the baseline ~v.18 features assumed to be on disk.
+ //They'll be first in the incompat list.
+ ondisk_features = CompatSet(NULL, 0, NULL, 0,
+ ceph_mon_feature_incompat,
+ 1);
+ } else {
+ bufferlist::iterator it = features.begin();
+ ondisk_features.decode(it);
}
- bufferlist::iterator it = features.begin();
- ondisk_features.decode(it);
if (!mon_features.writeable(ondisk_features)) {
cerr << "monitor executable cannot read disk! Missing features: "
void CInode::_fetched(bufferlist& bl, Context *fin)
{
dout(10) << "_fetched" << dendl;
+ CompatSet& mds_features = mdcache->mds->mds_features;
bufferlist::iterator p = bl.begin();
nstring magic;
::decode(magic, p);
dout(10) << " magic is '" << magic << "' (expecting '" << CEPH_FS_ONDISK_MAGIC << "')" << dendl;
- if (magic != CEPH_FS_ONDISK_MAGIC) {
+ if (magic != CEPH_FS_ONDISK_MAGIC && magic != CEPH_FS_OLD_ONDISK_MAGIC) {
dout(0) << "on disk magic '" << magic << "' != my magic '" << CEPH_FS_ONDISK_MAGIC
<< "'" << dendl;
fin->finish(-EINVAL);
} else {
- ondisk_ino_features.decode(p);
- CompatSet& mds_features = mdcache->mds->mds_features;
+ if (magic != CEPH_FS_OLD_ONDISK_MAGIC) ondisk_ino_features.decode(p);
+ else ondisk_ino_features = mds_features;
if ( !mds_features.writeable(ondisk_ino_features)) {
dout(0) << "mds data on-disk uses unknown features!" << dendl;
CompatSet diff = mds_features.unsupported(ondisk_ino_features);
#include <boost/pool/pool.hpp>
-#define CEPH_FS_ONDISK_MAGIC "ceph fs volume v011"
+#define CEPH_FS_ONDISK_MAGIC "ceph fs volume v012"
+#define CEPH_FS_OLD_ONDISK_MAGIC "ceph fs volume v011"
//#define MDS_REF_SET // define me for improved debug output, sanity checking
#define CEPH_OSD_NEARFULL_RATIO .8
#define CEPH_OSD_FULL_RATIO .95
-
+//this #define copied from OSD.h
+#define CEPH_OSD_FEATURE_INCOMPAT_BASE "initial feature set(~v.18)"
/* osdreqid_t - caller name + incarnation# + tid to unique identify this request
}
void encode(bufferlist &bl) const {
- __u8 v = 1;
+ __u8 v = 2;
::encode(v, bl);
::encode(magic, bl);
::decode(oldest_map, bl);
::decode(newest_map, bl);
::decode(weight, bl);
- compat_features.decode(bl);
+ if (v >= 2) compat_features.decode(bl);
+ else { //upgrade it!
+ compat_features.incompat.insert(CEPH_OSD_FEATURE_INCOMPAT_BASE);
+ }
::decode(clean_thru, bl);
::decode(mounted, bl);
}
::decode(h, p);
if (h.magic != magic) {
- dout(0) << "on disk magic '" << h.magic << "' != my magic '"
- << magic << "'" << dendl;
- list<Context*> ls;
- ls.swap(waitfor_recover);
- finish_contexts(ls, -EINVAL);
- return;
+ //special-case nasty hack for an upgrade path
+#define CEPH_FS_ONDISK_MAGIC "ceph fs volume v012"
+#define CEPH_FS_OLD_ONDISK_MAGIC "ceph fs volume v011"
+ if (strcmp(magic, CEPH_FS_ONDISK_MAGIC) != 0
+ && strcmp(h.magic.c_str(), CEPH_FS_OLD_ONDISK_MAGIC) != 0) {
+ dout(0) << "on disk magic '" << h.magic << "' != my magic '"
+ << magic << "'" << dendl;
+ list<Context*> ls;
+ ls.swap(waitfor_recover);
+ finish_contexts(ls, -EINVAL);
+ return;
+ }
}
set_layout(&h.layout);