From d866814285667c7f9cd9205dca6cf95f3634c5fc Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Fri, 22 Mar 2013 13:48:49 -0700 Subject: [PATCH] PG,osd_types: improve check_new_interval debugging Backport: bobtail Signed-off-by: Samuel Just Reviewed-by: Sage Weil (cherry picked from commit d611eba9caf45f2d977c627b123462a073f523a4) --- src/osd/PG.cc | 9 ++++++++- src/osd/osd_types.cc | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 60ec8e4f66222..fbaf70c23e568 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -4745,13 +4745,20 @@ void PG::start_peering_interval(const OSDMapRef lastmap, dout(10) << " no lastmap" << dendl; dirty_info = true; } else { + std::stringstream debug; bool new_interval = pg_interval_t::check_new_interval( oldacting, newacting, oldup, newup, info.history.same_interval_since, info.history.last_epoch_clean, osdmap, - lastmap, info.pgid.pool(), info.pgid, &past_intervals); + lastmap, + info.pgid.pool(), + info.pgid, + &past_intervals, + &debug); + dout(10) << __func__ << ": check_new_interval output: " + << debug.str() << dendl; if (new_interval) { dout(10) << " noting past " << past_intervals.rbegin()->second << dendl; dirty_info = true; diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index e0f2b98728126..56619f5a4fc10 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -1581,6 +1581,13 @@ bool pg_interval_t::check_new_interval( if (i.acting.size() >= osdmap->get_pools().find(pool_id)->second.min_size) { + if (out) + *out << "generate_past_intervals " << i + << ": not rw," + << " up_thru " << lastmap->get_up_thru(i.acting[0]) + << " up_from " << lastmap->get_up_from(i.acting[0]) + << " last_epoch_clean " << last_epoch_clean + << std::endl; if (lastmap->get_up_thru(i.acting[0]) >= i.first && lastmap->get_up_from(i.acting[0]) <= i.first) { i.maybe_went_rw = true; -- 2.39.5