From 9db78090451e609e3520ac3e57a5f53da03f9ee2 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 e3e214436d992..1578a87463e85 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1334,6 +1334,8 @@ void PG::activate(ObjectStore::Transaction& t, list& tfin, 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) { @@ -1374,7 +1376,9 @@ void PG::activate(ObjectStore::Transaction& t, list& tfin, } // 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