]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd,osdc: eliminate FLAG_ONDISK and helpers
authorSamuel Just <sjust@redhat.com>
Thu, 16 Feb 2017 21:22:07 +0000 (13:22 -0800)
committerSamuel Just <sjust@redhat.com>
Fri, 24 Feb 2017 19:27:02 +0000 (11:27 -0800)
The objecter actually always needs to get a response in order to
be able to not continually resend ops (even if the caller didn't
provide a callback).  Thus, it makes no sense for an MOSDOp to
ever not have FLAG_ONDISK set.  Therefore, we'll just remove the
helper and assume it's always there (it's safe to send a response
the client didn't ask for, the error paths already do that).  On
the Objecter side, we'll just unconditionally fill in ONDISK for
the benefit of pre-luminous OSDs.

Fixes: http://tracker.ceph.com/issues/18961
Signed-off-by: Samuel Just <sjust@redhat.com>
src/messages/MOSDOp.h
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h
src/osdc/Objecter.cc

index 8946652a913e1bf3c8e4a803cef6474fabf81121..b6797ac9d1b8d2e14df9ec09dac3a939e558e88c 100755 (executable)
@@ -232,13 +232,6 @@ public:
   }
 
   bool has_flag(__u32 flag) const { return flags & flag; };
-  bool wants_ack() const { return flags & CEPH_OSD_FLAG_ACK; }
-  bool wants_ondisk() const { return flags & CEPH_OSD_FLAG_ONDISK; }
-  bool wants_onnvram() const { return flags & CEPH_OSD_FLAG_ONNVRAM; }
-
-  void set_want_ack(bool b) { flags |= CEPH_OSD_FLAG_ACK; }
-  void set_want_onnvram(bool b) { flags |= CEPH_OSD_FLAG_ONNVRAM; }
-  void set_want_ondisk(bool b) { flags |= CEPH_OSD_FLAG_ONDISK; }
 
   bool is_retry_attempt() const { return flags & CEPH_OSD_FLAG_RETRY; }
   void set_retry_attempt(unsigned a) { 
index 68e61f903ad5386f93520735752d5d88c1801d0c..49a18946438a94519aec4068f1808b34d2581314 100644 (file)
@@ -2824,7 +2824,7 @@ void PrimaryLogPG::finish_proxy_write(hobject_t oid, ceph_tid_t tid, int r)
   const MOSDOp *m = static_cast<const MOSDOp*>(pwop->op->get_req());
   assert(m != NULL);
 
-  if (m->wants_ondisk() && !pwop->sent_disk) {
+  if (!pwop->sent_reply) {
     // send commit.
     MOSDOpReply *reply = pwop->ctx->reply;
     if (reply)
@@ -2836,21 +2836,8 @@ void PrimaryLogPG::finish_proxy_write(hobject_t oid, ceph_tid_t tid, int r)
     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());
-    pwop->sent_disk = true;
+    pwop->sent_reply = true;
     pwop->ctx->op->mark_commit_sent();
-  } else if (m->wants_ack() && !pwop->sent_ack && !pwop->sent_disk) {
-    // send ack
-    MOSDOpReply *reply = pwop->ctx->reply;
-    if (reply)
-      pwop->ctx->reply = NULL;
-    else {
-      reply = new MOSDOpReply(m, r, get_osdmap()->get_epoch(), 0, true);
-      reply->set_reply_versions(eversion_t(), pwop->user_version);
-    }
-    reply->add_flags(CEPH_OSD_FLAG_ACK);
-    dout(10) << " sending ack on " << pwop << " " << reply << dendl;
-    osd->send_message_osd_client(reply, m->get_connection());
-    pwop->sent_ack = true;
   }
 
   delete pwop->ctx;
@@ -3133,7 +3120,7 @@ void PrimaryLogPG::execute_ctx(OpContext *ctx)
        log_op_stats(
          ctx);
 
-      if (m && (m->wants_ondisk() || m->wants_ack()) && !ctx->sent_reply) {
+      if (m && !ctx->sent_reply) {
        MOSDOpReply *reply = ctx->reply;
        if (reply)
          ctx->reply = NULL;
@@ -8311,7 +8298,6 @@ void PrimaryLogPG::eval_repop(RepGather *repop)
 
   if (m)
     dout(10) << "eval_repop " << *repop
-            << " wants=" << (m->wants_ack() ? "a":"") << (m->wants_ondisk() ? "d":"")
             << (repop->rep_done ? " DONE" : "")
             << dendl;
   else
index f48c1610c8e83d2f1b30780027e063bd71b0af54..f79a41c85fbdca264e83fec863a09a6bdf771791 100644 (file)
@@ -205,8 +205,7 @@ public:
     ceph_tid_t objecter_tid;
     vector<OSDOp> &ops;
     version_t user_version;
-    bool sent_disk;
-    bool sent_ack;
+    bool sent_reply;
     utime_t mtime;
     bool canceled;
     osd_reqid_t reqid;
@@ -214,8 +213,8 @@ public:
     ProxyWriteOp(OpRequestRef _op, hobject_t oid, vector<OSDOp>& _ops, osd_reqid_t _reqid)
       : ctx(NULL), op(_op), soid(oid),
         objecter_tid(0), ops(_ops),
-       user_version(0), sent_disk(false),
-       sent_ack(false), canceled(false),
+       user_version(0), sent_reply(false),
+       canceled(false),
         reqid(_reqid) { }
   };
   typedef ceph::shared_ptr<ProxyWriteOp> ProxyWriteOpRef;
index 69a141329a3d334fad0a2ef6e0a27e9eab32f9d0..3cca39e5accd2c6a5f87381578d67cb658b05dea 100644 (file)
@@ -3058,8 +3058,10 @@ MOSDOp *Objecter::_prepare_osd_op(Op *op)
 
   int flags = op->target.flags;
   flags |= CEPH_OSD_FLAG_KNOWN_REDIR;
-  if (op->onfinish)
-    flags |= CEPH_OSD_FLAG_ONDISK;
+
+  // Nothing checks this any longer, but needed for compatibility with
+  // pre-luminous osds
+  flags |= CEPH_OSD_FLAG_ONDISK;
 
   if (!honor_osdmap_full)
     flags |= CEPH_OSD_FLAG_FULL_FORCE;