From d9949e2873ffaab392a1c833dc53dcf2199322ca Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 22 Mar 2016 14:10:47 -0700 Subject: [PATCH] Revert "osd: drop create events based on same_primary_since, not interval" This is a bit tricky, the history, acting, up, etc, calculated around project_pg_history aren't necessarily valid unless we are in the same interval as when the message was sent. We could work around that, but I'd rather fix it another way. This reverts commit f41cb1668672b550baad75bd4cab79258a2af99d. Signed-off-by: Samuel Just --- src/osd/OSD.cc | 24 ++---------------------- src/osd/OSD.h | 1 - 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 57242a48b46f8..1bff914749155 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -3409,7 +3409,6 @@ void OSD::handle_pg_peering_evt( const pg_history_t& orig_history, pg_interval_map_t& pi, epoch_t epoch, - bool same_primary, PG::CephPeeringEvtRef evt) { if (service.splitting(pgid)) { @@ -3431,14 +3430,7 @@ void OSD::handle_pg_peering_evt( bool valid_history = project_pg_history( pgid, history, epoch, up, up_primary, acting, acting_primary); - if (same_primary && epoch < history.same_primary_since) { - dout(10) << "get_or_create_pg " << pgid << " primary changed in " - << history.same_primary_since << " (msg from " << epoch << ")" - << dendl; - return; - } - if (!valid_history || - (!same_primary && epoch < history.same_interval_since)) { + if (!valid_history || epoch < history.same_interval_since) { dout(10) << "get_or_create_pg " << pgid << " acting changed in " << history.same_interval_since << " (msg from " << epoch << ")" << dendl; @@ -3564,15 +3556,7 @@ void OSD::handle_pg_peering_evt( } else { // already had it. did the mapping change? PG *pg = _lookup_lock_pg(pgid); - if (same_primary && epoch < pg->info.history.same_primary_since) { - dout(10) << "get_or_create_pg " << pgid << " primary changed in " - << pg->info.history.same_primary_since - << " (msg from " << epoch << ")" - << dendl; - pg->unlock(); - return; - } - if (!same_primary && epoch < pg->info.history.same_interval_since) { + if (epoch < pg->info.history.same_interval_since) { dout(10) << *pg << " get_or_create_pg acting changed in " << pg->info.history.same_interval_since << " (msg from " << epoch << ")" << dendl; @@ -7500,7 +7484,6 @@ void OSD::handle_pg_create(OpRequestRef op) history, pi, m->epoch, - true, // same primary, bc this is a create PG::CephPeeringEvtRef( new PG::CephPeeringEvt( m->epoch, @@ -7733,7 +7716,6 @@ void OSD::handle_pg_notify(OpRequestRef op) spg_t(it->first.info.pgid.pgid, it->first.to), it->first.info.history, it->second, it->first.query_epoch, - false, // same interval PG::CephPeeringEvtRef( new PG::CephPeeringEvt( it->first.epoch_sent, it->first.query_epoch, @@ -7765,7 +7747,6 @@ void OSD::handle_pg_log(OpRequestRef op) handle_pg_peering_evt( spg_t(m->info.pgid.pgid, m->to), m->info.history, m->past_intervals, m->get_epoch(), - false, // same interval PG::CephPeeringEvtRef( new PG::CephPeeringEvt( m->get_epoch(), m->get_query_epoch(), @@ -7799,7 +7780,6 @@ void OSD::handle_pg_info(OpRequestRef op) handle_pg_peering_evt( spg_t(p->first.info.pgid.pgid, p->first.to), p->first.info.history, p->second, p->first.epoch_sent, - false, // same interval PG::CephPeeringEvtRef( new PG::CephPeeringEvt( p->first.epoch_sent, p->first.query_epoch, diff --git a/src/osd/OSD.h b/src/osd/OSD.h index d6a8d2dd7ad53..cccd0d47f2f89 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1968,7 +1968,6 @@ protected: const pg_history_t& orig_history, pg_interval_map_t& pi, epoch_t epoch, - bool same_primary, PG::CephPeeringEvtRef evt); void load_pgs(); -- 2.39.5