]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: process re-sent async dir operations at clientreplay stage
authorYan, Zheng <zyan@redhat.com>
Mon, 13 Jan 2020 03:24:15 +0000 (11:24 +0800)
committerYan, Zheng <zyan@redhat.com>
Tue, 4 Feb 2020 02:17:34 +0000 (10:17 +0800)
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/include/ceph_fs.h
src/mds/Locker.cc
src/mds/Server.cc
src/messages/MClientRequest.h

index 47094e1cc0ed2ca2fd7ec96cde6a24577813e6a3..f7bf65c066248f3d39ca4af7775e999aac72f7e7 100644 (file)
@@ -526,6 +526,7 @@ union ceph_mds_request_args_legacy {
 
 #define CEPH_MDS_FLAG_REPLAY        1  /* this is a replayed op */
 #define CEPH_MDS_FLAG_WANT_DENTRY   2  /* want dentry in reply */
+#define CEPH_MDS_FLAG_ASYNC         4  /* request is async */
 
 struct ceph_mds_request_head_legacy {
        __le64 oldest_client_tid;
index 7c5c0488ffff232a8bb0d392a1bd5bfcde7ffc3a..79ec9dc4711f99ad5f36549813278cdbd0d9ca38 100644 (file)
@@ -2186,8 +2186,8 @@ Capability* Locker::issue_new_caps(CInode *in,
   Session *session = mdr->session;
   bool new_inode = (mdr->alloc_ino || mdr->used_prealloc_ino);
 
-  // if replay, try to reconnect cap, and otherwise do nothing.
-  if (new_inode && mdr->client_request->is_replay())
+  // if replay or async, try to reconnect cap, and otherwise do nothing.
+  if (new_inode && mdr->client_request->is_queued_for_replay())
     return mds->mdcache->try_reconnect_cap(in, session);
 
   // my needs
index a1ec18ba67670e63e4876f4101479a01d1e379db..4094c11ac7ac4bac54572eaa8730c38f1b759d4e 100644 (file)
@@ -262,7 +262,7 @@ void Server::dispatch(const cref_t<Message> &m)
        return;
       }
       bool queue_replay = false;
-      if (req->is_replay()) {
+      if (req->is_replay() || req->is_async()) {
        dout(3) << "queuing replayed op" << dendl;
        queue_replay = true;
        if (req->head.ino &&
index d565f204ac50990983afd50b7ca547b41d6d4edf..29c60ddcb7ceefa7f1847f129bfdfb8834f990fc 100644 (file)
@@ -132,6 +132,9 @@ public:
   bool is_replay() const {
     return get_flags() & CEPH_MDS_FLAG_REPLAY;
   }
+  bool is_async() const {
+    return get_flags() & CEPH_MDS_FLAG_ASYNC;
+  }
 
   // normal fields
   void set_stamp(utime_t t) { stamp = t; }
@@ -155,6 +158,9 @@ public:
   void set_replayed_op() {
     head.flags = head.flags | CEPH_MDS_FLAG_REPLAY;
   }
+  void set_async_op() {
+    head.flags = head.flags | CEPH_MDS_FLAG_ASYNC;
+  }
 
   utime_t get_stamp() const { return stamp; }
   ceph_tid_t get_oldest_client_tid() const { return head.oldest_client_tid; }
@@ -267,7 +273,9 @@ public:
       out << " " << stamp;
     if (head.num_retry)
       out << " RETRY=" << (int)head.num_retry;
-    if (get_flags() & CEPH_MDS_FLAG_REPLAY)
+    if (is_async())
+      out << " ASYNC";
+    if (is_replay())
       out << " REPLAY";
     if (queued_for_replay)
       out << " QUEUED_FOR_REPLAY";