From: Sage Weil Date: Wed, 25 Sep 2019 15:59:42 +0000 (-0500) Subject: osd/PrimaryLogPG: remove finish_proxy_write reply path X-Git-Tag: v15.1.0~1384^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=aba33749ed2a55d17b513dbdf3fa02942a83a022;p=ceph.git osd/PrimaryLogPG: remove finish_proxy_write reply path There is no case where we have already allocated a reply message here, since that is only done in execute_ctx() after the transaction is prepared, something that doesn't happen if we proxy the write through to the base layer. Signed-off-by: Sage Weil --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index ca3277da8285..ff7b1c0dc021 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -3452,13 +3452,9 @@ void PrimaryLogPG::finish_proxy_write(hobject_t oid, ceph_tid_t tid, int r) if (!pwop->sent_reply) { // send commit. - MOSDOpReply *reply = pwop->ctx->reply; - if (reply) - pwop->ctx->reply = NULL; - else { - reply = new MOSDOpReply(m, r, get_osdmap_epoch(), 0, true); - reply->set_reply_versions(eversion_t(), pwop->user_version); - } + assert(pwop->ctx->reply == nullptr); + MOSDOpReply *reply = new MOSDOpReply(m, r, get_osdmap_epoch(), 0, true); + reply->set_reply_versions(eversion_t(), pwop->user_version); reply->add_flags(CEPH_OSD_FLAG_ACK | CEPH_OSD_FLAG_ONDISK); dout(10) << " sending commit on " << pwop << " " << reply << dendl; osd->send_message_osd_client(reply, m->get_connection()); @@ -3728,6 +3724,7 @@ void PrimaryLogPG::execute_ctx(OpContext *ctx) // prepare the reply ctx->reply = new MOSDOpReply(m, 0, get_osdmap_epoch(), 0, successful_write); + dout(20) << __func__ << " alloc reply " << ctx->reply << dendl; // Write operations aren't allowed to return a data payload because // we can't do so reliably. If the client has to resend the request