From 9553c6edfbad4f5b64e1cc6ad8b3394a0b100e98 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 26 Jul 2012 16:35:00 -0700 Subject: [PATCH] osd: fixing sharing of past_intervals on backfill restart 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 Reviewed-by: Yehuda Sadeh --- src/osd/PG.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 4a06a11f45ce5..f923af6424c8a 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1390,6 +1390,8 @@ void PG::activate(ObjectStore::Transaction& t, 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) { @@ -1434,7 +1436,9 @@ void PG::activate(ObjectStore::Transaction& t, } // 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()) -- 2.39.5