]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: accommodate new past_intervals encoding
authorSamuel Just <sjust@redhat.com>
Fri, 20 Jan 2017 20:50:42 +0000 (12:50 -0800)
committerSage Weil <sage@redhat.com>
Fri, 28 Apr 2017 15:30:38 +0000 (11:30 -0400)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/PG.cc
src/osd/PG.h

index 051dc34c9e31958786c03fe813f7ab1451563cb5..e13666fc92037ff24dfeb8d78af20cab72eaa1cd 100644 (file)
@@ -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();
index c61574b4e6bb254a02ee84a19f614fe896869c15..0908f929a7848ff83fe8bce3e221c0fe7e7cb9e0 100644 (file)
@@ -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