]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PeeringState: track down OSDs relevant to prior_readable_until_ub
authorSage Weil <sage@redhat.com>
Tue, 23 Jul 2019 19:07:59 +0000 (14:07 -0500)
committerSage Weil <sage@redhat.com>
Sat, 28 Sep 2019 16:51:18 +0000 (11:51 -0500)
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 <sage@redhat.com>
src/osd/PeeringState.cc
src/osd/PeeringState.h

index 07c0e252b367dec70f4a0a51b410dd9bb6e25f3e..a01c7bedd2942408621a28685836a244560f3878 100644 (file)
@@ -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;
 }
index 6f9c4b1e2d63e5668a28794c7f8c3427affd7e0e..45d49fcae31599e981f167c40c95223d4e89e547 100644 (file)
@@ -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<int> 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<int>& 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) {