From 339ae18b127984e03c161ae449a6e90129fc9d3b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 8 Jun 2018 07:29:31 -0500 Subject: [PATCH] osd/PG: create new PGs from activate in last_peering_reset epoch 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 --- src/messages/MOSDPGLog.h | 2 +- src/osd/PG.cc | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/messages/MOSDPGLog.h b/src/messages/MOSDPGLog.h index e590cdd30ab52..55932213bb263 100644 --- a/src/messages/MOSDPGLog.h +++ b/src/messages/MOSDPGLog.h @@ -60,7 +60,7 @@ public: true, new PGCreateInfo( get_spg(), - epoch, + query_epoch, info.history, past_intervals, false)); diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 97564c378ba61..6a794db2b3f1b 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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); } -- 2.39.5