]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG::activate: handle peer contigious with primary, but not auth_log 1459/head
authorSamuel Just <sam.just@inktank.com>
Fri, 14 Mar 2014 01:16:19 +0000 (18:16 -0700)
committerSamuel Just <sam.just@inktank.com>
Fri, 14 Mar 2014 17:57:47 +0000 (10:57 -0700)
The added case covers a situation where a replica is not contiguous with
the auth_log, but is contiguous with the primary.  Reshuffling the
active set to handle this would be tricky, so instead we just go ahead
and backfill it anyway.  This is probably preferrable in any case since
the replica in question would have to be significantly behind.

Fixes: #7696
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/PG.cc

index fe759efe1422fb28105c5869ce1fb5831d0b387b..aeec9d655a4ef54460ed0f8ffb3329b915a7d0b7 100644 (file)
@@ -1514,7 +1514,17 @@ void PG::activate(ObjectStore::Transaction& t,
            i->shard, pg_whoami.shard,
            get_osdmap()->get_epoch(), info);
        }
-      } else if (pg_log.get_tail() > pi.last_update || pi.last_backfill == hobject_t()) {
+      } else if (
+       pg_log.get_tail() > pi.last_update ||
+       pi.last_backfill == hobject_t() ||
+       (backfill_targets.count(*i) && pi.last_backfill.is_max())) {
+       /* This last case covers a situation where a replica is not contiguous
+        * with the auth_log, but is contiguous with this replica.  Reshuffling
+        * the active set to handle this would be tricky, so instead we just go
+        * ahead and backfill it anyway.  This is probably preferrable in any
+        * case since the replica in question would have to be significantly
+        * behind.
+        */
        // backfill
        osd->clog.info() << info.pgid << " restarting backfill on osd." << peer
                         << " from (" << pi.log_tail << "," << pi.last_update << "] " << pi.last_backfill