]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: send ops back to primary if replica is not readable
authorSage Weil <sage@redhat.com>
Tue, 23 Jul 2019 19:01:34 +0000 (14:01 -0500)
committerSage Weil <sage@redhat.com>
Thu, 26 Sep 2019 17:22:22 +0000 (12:22 -0500)
This is the simplest strategy--much simpler than queueing them and
waking them up again later.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PeeringState.cc
src/osd/PrimaryLogPG.cc

index 98e70ac1f36ca3014680d32019125983a0b33fbb..07c0e252b367dec70f4a0a51b410dd9bb6e25f3e 100644 (file)
@@ -1145,7 +1145,8 @@ void PeeringState::proc_lease(const pg_lease_t& l)
   if (ru > readable_until) {
     readable_until = ru;
     psdout(20) << __func__ << " readable_until now " << readable_until << dendl;
-#warning fixme: wake up replica?
+    // NOTE: if we ever decide to block/queue ops on the replica,
+    // we'll need to wake them up here.
   }
 
   ceph::signedspan ruub;
index de99a66acb95ad525f990d48090cc8c44a79dedb..2947c51f37c6d492fa721507135fee072891444f 100644 (file)
@@ -767,6 +767,11 @@ bool PrimaryLogPG::check_laggy(OpRequestRef& op)
             << " mnow " << mnow
             << " > readable_until " << ru << dendl;
 
+    if (!is_primary()) {
+      osd->reply_op_error(op, -EAGAIN);
+      return false;
+    }
+
     // go to laggy state
     state_set(PG_STATE_LAGGY);
     publish_stats_to_osd();