From: Samuel Just Date: Fri, 20 Jan 2017 20:50:42 +0000 (-0800) Subject: PG: accommodate new past_intervals encoding X-Git-Tag: v12.0.3~129^2~34 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3ed85f0f2e57c67099be50abea3d2230c7dd7c4e;p=ceph.git PG: accommodate new past_intervals encoding Signed-off-by: Samuel Just --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 051dc34c9e31..e13666fc9203 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -2734,11 +2734,13 @@ void PG::init( void PG::upgrade(ObjectStore *store) { - assert(info_struct_v <= 9); + assert(info_struct_v <= 10); ObjectStore::Transaction t; assert(info_struct_v >= 7); + // no special action needed for 9->10, just write out the biginfo + // 8 -> 9 if (info_struct_v <= 8) { // no special action needed. @@ -3134,7 +3136,11 @@ int PG::read_info( ::decode(info, p); p = values[biginfo_key].begin(); - ::decode(past_intervals, p); + if (struct_v >= 10) { + ::decode(past_intervals, p); + } else { + past_intervals.decode_classic(p); + } ::decode(info.purged_snaps, p); p = values[fastinfo_key].begin(); diff --git a/src/osd/PG.h b/src/osd/PG.h index c61574b4e6bb..0908f929a784 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -287,7 +287,8 @@ public: pg_info_t info; ///< current pg info pg_info_t last_written_info; ///< last written info __u8 info_struct_v; - static const __u8 cur_struct_v = 9; + static const __u8 cur_struct_v = 10; + // v10 is the new past_intervals encoding // v9 was fastinfo_key addition // v8 was the move to a per-pg pgmeta object // v7 was SnapMapper addition in 86658392516d5175b2756659ef7ffaaf95b0f8ad