]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PrimaryLogPG: remove finish_proxy_write reply path
authorSage Weil <sage@redhat.com>
Wed, 25 Sep 2019 15:59:42 +0000 (10:59 -0500)
committerSage Weil <sage@redhat.com>
Wed, 25 Sep 2019 16:01:09 +0000 (11:01 -0500)
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 <sage@redhat.com>
src/osd/PrimaryLogPG.cc

index ca3277da8285077e84633d9efd39ca9d73deebff..ff7b1c0dc021990adac30007de80b33c60b9db56 100644 (file)
@@ -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