diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 7fba0871b86..47ded0ab087 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -134,6 +134,7 @@ static CompatSet get_osd_compat_set() { ceph_osd_feature_incompat.insert(CEPH_OSD_FEATURE_INCOMPAT_LEC); ceph_osd_feature_incompat.insert(CEPH_OSD_FEATURE_INCOMPAT_CATEGORIES); ceph_osd_feature_incompat.insert(CEPH_OSD_FEATURE_INCOMPAT_HOBJECTPOOL); + ceph_osd_feature_incompat.insert(CEPH_OSD_FEATURE_INCOMPAT_BIGINFO); return CompatSet(ceph_osd_feature_compat, ceph_osd_feature_ro_compat, ceph_osd_feature_incompat); } diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 59156f7a8b2..92f443198be 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1994,16 +1994,15 @@ void PG::write_info(ObjectStore::Transaction& t) { // pg state bufferlist infobl; - __u8 struct_v = 3; + __u8 struct_v = 4; ::encode(struct_v, infobl); - ::encode(info, infobl); - dout(20) << "write_info info " << infobl.length() << dendl; t.collection_setattr(coll, "info", infobl); // potentially big stuff bufferlist bigbl; ::encode(past_intervals, bigbl); ::encode(snap_collections, bigbl); + ::encode(info, bigbl); dout(20) << "write_info bigbl " << bigbl.length() << dendl; t.truncate(coll_t::META_COLL, biginfo_oid, 0); t.write(coll_t::META_COLL, biginfo_oid, 0, bigbl.length(), bigbl); @@ -2434,7 +2433,8 @@ void PG::read_state(ObjectStore *store) store->collection_getattr(coll, "info", bl); p = bl.begin(); ::decode(struct_v, p); - ::decode(info, p); + if (struct_v < 4) + ::decode(info, p); if (struct_v < 2) { ::decode(past_intervals, p); @@ -2461,6 +2461,8 @@ void PG::read_state(ObjectStore *store) } } else { ::decode(snap_collections, p); + if (struct_v >= 4) + ::decode(info, p); } try { diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index b144d390994..d3f3776a702 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -37,6 +37,7 @@ #define CEPH_OSD_FEATURE_INCOMPAT_LEC CompatSet::Feature(4, "last_epoch_clean") #define CEPH_OSD_FEATURE_INCOMPAT_CATEGORIES CompatSet::Feature(5, "categories") #define CEPH_OSD_FEATURE_INCOMPAT_HOBJECTPOOL CompatSet::Feature(6, "hobjectpool") +#define CEPH_OSD_FEATURE_INCOMPAT_BIGINFO CompatSet::Feature(7, "biginfo") typedef hobject_t collection_list_handle_t;