]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: update info.history even if lastmap is absent
authorSamuel Just <samuel.just@dreamhost.com>
Thu, 10 Nov 2011 01:16:57 +0000 (17:16 -0800)
committerSamuel Just <samuel.just@dreamhost.com>
Thu, 10 Nov 2011 01:17:34 +0000 (17:17 -0800)
Previously, we did not update same_interval_since etc if
we do not have the previous map.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
src/osd/PG.cc

index 7cfdfcd0630ee55e49213ef85a500c38f8745649..a16f1cfdd0815f278d35a396953d6e2f87c326e0 100644 (file)
@@ -3525,13 +3525,6 @@ void PG::start_peering_interval(const OSDMapRef lastmap,
     i.acting = oldacting;
     i.up = oldup;
 
-    if (oldacting != acting || oldup != up) {
-      info.history.same_interval_since = osdmap->get_epoch();
-    }
-    if (oldup != up) {
-      info.history.same_up_since = osdmap->get_epoch();
-    }
-
     if (i.acting.size()) {
       i.maybe_went_rw =
        lastmap->get_up_thru(i.acting[0]) >= i.first &&
@@ -3540,14 +3533,20 @@ void PG::start_peering_interval(const OSDMapRef lastmap,
       i.maybe_went_rw = 0;
     }
 
-    if (oldprimary != get_primary()) {
-      info.history.same_primary_since = osdmap->get_epoch();
-    }
-
     dout(10) << " noting past " << i << dendl;
     dirty_info = true;
   }
 
+  if (oldacting != acting || oldup != up) {
+    info.history.same_interval_since = osdmap->get_epoch();
+  }
+  if (oldup != up) {
+    info.history.same_up_since = osdmap->get_epoch();
+  }
+  if (oldprimary != get_primary()) {
+    info.history.same_primary_since = osdmap->get_epoch();
+  }
+
   dout(10) << " up " << oldup << " -> " << up 
           << ", acting " << oldacting << " -> " << acting 
           << ", role " << oldrole << " -> " << role << dendl;