]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: clear past_intervals as needed on upgrade
authorSage Weil <sage@redhat.com>
Mon, 17 Apr 2017 14:01:45 +0000 (10:01 -0400)
committerSage Weil <sage@redhat.com>
Fri, 28 Apr 2017 15:32:17 +0000 (11:32 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PG.cc

index 25fb632aaafc9a11ff5232d255799c601cac27b9..76759c0f5767b38d9f26e99a086ce7d920127ae3 100644 (file)
@@ -2766,13 +2766,6 @@ void PG::upgrade(ObjectStore *store)
 
   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.
-  }
-
   // 7 -> 8
   if (info_struct_v <= 7) {
     pg_log.mark_log_for_rewrite();
@@ -2788,6 +2781,20 @@ void PG::upgrade(ObjectStore *store)
     t.omap_setkeys(coll, pgmeta_oid, v);
   }
 
+  // 8 -> 9
+  if (info_struct_v <= 8) {
+    // no special action needed.
+  }
+
+  // 9 -> 10
+  if (info_struct_v <= 9) {
+    // previous versions weren't (as) aggressively clearing past_intervals
+    if (info.history.last_epoch_clean >= info.history.same_interval_since) {
+      dout(20) << __func__ << " clearing past_intervals" << dendl;
+      past_intervals.clear();
+    }
+  }
+
   dirty_info = true;
   dirty_big_info = true;
   write_if_dirty(t);