From: Sage Weil Date: Tue, 10 Sep 2019 21:41:18 +0000 (-0500) Subject: osdc/Objecter: resend OSD tell commands on EAGAIN X-Git-Tag: v15.1.0~1323^2~24 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ecfd5ba4cf8dc265620027cd0a8fcd3b2a962d12;p=ceph.git osdc/Objecter: resend OSD tell commands on EAGAIN 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 --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index b733173fd276c..aa38e1f82cdf0 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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; diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index a6db93d3dc6e5..6acece251ace5 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -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()); }