From aba33749ed2a55d17b513dbdf3fa02942a83a022 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 25 Sep 2019 10:59:42 -0500 Subject: [PATCH] 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 --- src/osd/PrimaryLogPG.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index ca3277da828..ff7b1c0dc02 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 -- 2.39.5