]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Objecter: resend OSD tell commands on EAGAIN
authorSage Weil <sage@redhat.com>
Tue, 10 Sep 2019 21:41:18 +0000 (16:41 -0500)
committerSage Weil <sage@redhat.com>
Fri, 4 Oct 2019 14:07:02 +0000 (09:07 -0500)
Request map *and* resend.  We don't have map epoch info about when the
reply was sent, and the OSD isn't ordering with respect to epochs anyway.
So, resend now, just in case we already saw a map change, or because we
were suffering from a peering vs command race on the OSD side, and then
also request a new map from the mon, in case we are missing a map update.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc
src/osdc/Objecter.cc

index b733173fd276cb6c0002b50ac982678112c8c685..aa38e1f82cdf00841f168d09cec391e078f1f5a7 100644 (file)
@@ -2411,7 +2411,6 @@ void OSD::asok_command(
        ss << "not primary for pgid " << pgid;
        // do not reply; they will get newer maps and realize they
        // need to resend.
-#warning fixme on client side
        pg->unlock();
        ret = -EAGAIN;
        goto out;
index a6db93d3dc6e5d16af849401faadb43fc9813ff8..6acece251ace5271abe0da5c932b7eb32ac5e976 100644 (file)
@@ -4781,6 +4781,18 @@ void Objecter::handle_command_reply(MCommandReply *m)
     sl.unlock();
     return;
   }
+  if (m->r == -EAGAIN) {
+    ldout(cct,10) << __func__ << " tid " << m->get_tid()
+                 << " got EAGAIN, requesting map and resending" << dendl;
+    // NOTE: This might resend twice... once now, and once again when
+    // we get an updated osdmap and the PG is found to have moved.
+    _maybe_request_map();
+    _send_command(c);
+    m->put();
+    sl.unlock();
+    return;
+  }
+
   if (c->poutbl) {
     c->poutbl->claim(m->get_data());
   }