]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fixing sharing of past_intervals on backfill restart
authorSage Weil <sage@inktank.com>
Thu, 26 Jul 2012 23:35:00 +0000 (16:35 -0700)
committerSage Weil <sage@inktank.com>
Thu, 26 Jul 2012 23:35:10 +0000 (16:35 -0700)
We need to share past_intervals whenever we instantiate the PG on a peer.
In the PG activation case, this is based on whether our peer_info[] value
for that peer is dne().  However, the backfill code was updating the
peer info (history) in the block preceeding the dne() check, which meant
we never shared past_intervals in this case and the peer would have to
chew through a potentially large number of maps if the PG has not been
clean recently.

Fix by checking dne() prior to the backfill block.  We still need to fill
in the message later because it isn't yet instantiated.

Fixes: #2849
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
src/osd/PG.cc

index e3e214436d99234354504c62bd5234b6b822beb7..1578a87463e855db2a1ada95392e2ca3e2dc7f1f 100644 (file)
@@ -1334,6 +1334,8 @@ void PG::activate(ObjectStore::Transaction& t, list<Context*>& tfin,
       MOSDPGLog *m = 0;
       pg_missing_t& pm = peer_missing[peer];
 
+      bool needs_past_intervals = pi.dne();
+
       if (pi.last_update == info.last_update) {
         // empty log
        if (!pi.is_empty() && activator_map) {
@@ -1374,7 +1376,9 @@ void PG::activate(ObjectStore::Transaction& t, list<Context*>& tfin,
       }
 
       // share past_intervals if we are creating the pg on the replica
-      if (pi.dne())
+      // based on whether our info for that peer was dne() *before*
+      // updating pi.history in the backfill block above.
+      if (needs_past_intervals)
        m->past_intervals = past_intervals;
 
       if (pi.last_backfill != hobject_t::get_max())