]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: create new PGs from activate in last_peering_reset epoch
authorSage Weil <sage@redhat.com>
Fri, 8 Jun 2018 12:29:31 +0000 (07:29 -0500)
committerSage Weil <sage@redhat.com>
Fri, 8 Jun 2018 19:04:39 +0000 (14:04 -0500)
If we create a new PG (e.g., a backfill target) in the current epoch, it
might be > last_peering_reset.  That can lead to last_peering_reset on
the replica having a higher last_peering_reset than the primary's, which
can then lead to future messages, like pg_scan during backfill, being
ignored.

Fixes: http://tracker.ceph.com/issues/24452
Signed-off-by: Sage Weil <sage@redhat.com>
src/messages/MOSDPGLog.h
src/osd/PG.cc

index e590cdd30ab529dd0919f5e4f4ad9662c37c3316..55932213bb26375912dfa7fdd55de36b3cf42627 100644 (file)
@@ -60,7 +60,7 @@ public:
       true,
       new PGCreateInfo(
        get_spg(),
-       epoch,
+       query_epoch,
        info.history,
        past_intervals,
        false));
index 97564c378ba61365e20884d943273418895220b0..6a794db2b3f1b0c6c1369140baa67d9a0baecfb3 100644 (file)
@@ -1948,7 +1948,8 @@ void PG::activate(ObjectStore::Transaction& t,
 
        m = new MOSDPGLog(
          i->shard, pg_whoami.shard,
-         get_osdmap()->get_epoch(), pi);
+         get_osdmap()->get_epoch(), pi,
+         last_peering_reset /* epoch to create pg at */);
 
        // send some recent log, so that op dup detection works well.
        m->log.copy_up_to(pg_log.get_log(), cct->_conf->osd_min_pg_log_entries);
@@ -1961,7 +1962,8 @@ void PG::activate(ObjectStore::Transaction& t,
        assert(pg_log.get_tail() <= pi.last_update);
        m = new MOSDPGLog(
          i->shard, pg_whoami.shard,
-         get_osdmap()->get_epoch(), info);
+         get_osdmap()->get_epoch(), info,
+         last_peering_reset /* epoch to create pg at */);
        // send new stuff to append to replicas log
        m->log.copy_after(pg_log.get_log(), pi.last_update);
       }