From f23434ea3ad39895eaddc1887c3991b981a1f097 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 23 Jul 2019 14:07:59 -0500 Subject: [PATCH] osd/PeeringState: track down OSDs relevant to prior_readable_until_ub Keep track of which OSDs from the prior set we care about that affect the prior_readable_until_ub. Note that it is only the *down* OSDs that we have to track here, since everything in the *probe* set we will already contact during peering (they are still up), guaranteeing that those PGs are aware of the interval change and are no longer readable in the prior interval. Signed-off-by: Sage Weil --- src/osd/PeeringState.cc | 7 ++++++- src/osd/PeeringState.h | 10 ++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 07c0e252b36..a01c7bedd29 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -763,6 +763,8 @@ void PeeringState::on_new_interval() psdout(10) << __func__ << " prior_readable_until_ub " << prior_readable_until_ub << " (mnow " << mnow << " + " << info.history.prior_readable_until_ub << ")" << dendl; + prior_readable_down_osds.clear(); // we populate this when we build the priorset + readable_until = readable_until_ub = readable_until_ub_sent = @@ -6196,6 +6198,7 @@ PeeringState::GetInfo::GetInfo(my_context ctx) ceph_assert(ps->blocked_by.empty()); prior_set = ps->build_prior(); + ps->prior_readable_down_osds = prior_set.down; ps->reset_min_peer_features(); get_infos(); @@ -6263,6 +6266,7 @@ boost::statechart::result PeeringState::GetInfo::react(const MNotifyRec& infoevt if (old_start < ps->info.history.last_epoch_started) { psdout(10) << " last_epoch_started moved forward, rebuilding prior" << dendl; prior_set = ps->build_prior(); + ps->prior_readable_down_osds = prior_set.down; // filter out any osds that got dropped from the probe set from // peer_info_requested. this is less expensive than restarting @@ -6921,7 +6925,8 @@ ostream &operator<<(ostream &out, const PeeringState &ps) { out << " NOTIFY"; if (ps.prior_readable_until_ub != ceph::signedspan::zero()) { - out << " pruub " << ps.prior_readable_until_ub; + out << " pruub " << ps.prior_readable_until_ub + << "@" << ps.get_prior_readable_down_osds(); } return out; } diff --git a/src/osd/PeeringState.h b/src/osd/PeeringState.h index 6f9c4b1e2d6..45d49fcae31 100644 --- a/src/osd/PeeringState.h +++ b/src/osd/PeeringState.h @@ -1364,9 +1364,13 @@ public: /// upper bound on any acting OSDs' readable_until in this interval ceph::signedspan readable_until_ub = ceph::signedspan::zero(); + /// upper bound from prior interval(s) ceph::signedspan prior_readable_until_ub = ceph::signedspan::zero(); + /// pg instances from prior interval(s) that may still be readable + set prior_readable_down_osds; + /// [replica] upper bound we got from the primary (primary's clock) ceph::signedspan readable_until_ub_from_primary = ceph::signedspan::zero(); @@ -1959,9 +1963,15 @@ public: return prior_readable_until_ub; } + /// Get prior intervals' readable_until down OSDs of note + const set& get_prior_readable_down_osds() const { + return prior_readable_down_osds; + } + /// Reset prior intervals' readable_until upper bound (e.g., bc it passed) void clear_prior_readable_until_ub() { prior_readable_until_ub = ceph::signedspan::zero(); + prior_readable_down_osds.clear(); } void renew_lease(ceph::signedspan now) { -- 2.39.5