]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/quiesce: don't force a remote authpin for the quiesce lock wip-lusov-quiesce-no-remote-ap 57580/head
authorLeonid Usov <leonid.usov@ibm.com>
Mon, 20 May 2024 22:03:15 +0000 (01:03 +0300)
committerLeonid Usov <leonid.usov@ibm.com>
Mon, 20 May 2024 22:05:52 +0000 (01:05 +0300)
Fixes: https://tracker.ceph.com/issues/66152
Fixes: https://tracker.ceph.com/issues/66123
Signed-off-by: Leonid Usov <leonid.usov@ibm.com>
qa/tasks/cephfs/test_quiesce.py
src/mds/Locker.cc
src/mds/Locker.h
src/mds/MDCache.cc
src/mds/Server.cc

index b6ef8cde324bcbddcddf252326e983ee2934cbc1..bf128d8d74f654cf445138c0c090e9f97ae420c5 100644 (file)
@@ -687,7 +687,6 @@ class TestQuiesceMultiRank(QuiesceTestCase):
         op = self.fs.rank_tell(["quiesce", "path", self.subvolume, '--wait'], rank=0)['op']
         self.assertEqual(op['result'], -1) # EPERM
 
-    @unittest.skip("https://tracker.ceph.com/issues/66152")
     def test_quiesce_drops_remote_authpins_on_failure(self):
         """
         That remote authpins are dropped when the request fails to acquire the quiesce lock
index 02115453027d6be1ae45d7936aa709254194574a..b84f7b59ee538dc9aade0fd6df64706ba96eab27 100644 (file)
@@ -230,7 +230,6 @@ struct MarkEventOnDestruct {
 bool Locker::acquire_locks(const MDRequestRef& mdr,
                           MutationImpl::LockOpVec& lov,
                           CInode* auth_pin_freeze,
-                           std::set<MDSCacheObject*> mustpin,
                           bool auth_pin_nonblocking,
                            bool skip_quiesce)
 {
@@ -245,6 +244,7 @@ bool Locker::acquire_locks(const MDRequestRef& mdr,
 
   client_t client = mdr->get_client();
 
+  std::set<MDSCacheObject*> mustpin;
   if (auth_pin_freeze)
     mustpin.insert(auth_pin_freeze);
 
@@ -294,7 +294,10 @@ bool Locker::acquire_locks(const MDRequestRef& mdr,
 
       dout(20) << " must xlock " << *lock << " " << *object << dendl;
 
-      mustpin.insert(object);
+      // only take the authpin for the quiesce lock on the auth
+      if (lock->get_type() != CEPH_LOCK_IQUIESCE || object->is_auth()) {
+        mustpin.insert(object);
+      }
 
       // augment xlock with a versionlock?
       if (lock->get_type() == CEPH_LOCK_DN) {
index a1ea4a260989c6bdd501576dcb56d9a4a112c0f6..aa037ac6abda728f729fdb8d8c0012a6882675b8 100644 (file)
@@ -54,7 +54,6 @@ public:
   bool acquire_locks(const MDRequestRef& mdr,
                     MutationImpl::LockOpVec& lov,
                     CInode *auth_pin_freeze=NULL,
-                     std::set<MDSCacheObject*> mustpin = {},
                     bool auth_pin_nonblocking=false,
                      bool skip_quiesce=false);
 
index 554616c3337990014ad1d14ac90171cdd46e968e..c6cfeb15466c1a8acb8452dbf74b44360cecf47c 100644 (file)
@@ -12090,7 +12090,7 @@ void MDCache::dispatch_fragment_dir(const MDRequestRef& mdr, bool abort_if_freez
       // prevent a racing gather on any other scatterlocks too
       lov.lock_scatter_gather(&diri->nestlock);
       lov.lock_scatter_gather(&diri->filelock);
-      if (mds->locker->acquire_locks(mdr, lov, NULL, {}, true)) {
+      if (mds->locker->acquire_locks(mdr, lov, NULL, true)) {
         mdr->locking_state |= MutationImpl::ALL_LOCKED;
       } else {
         if (!mdr->aborted) {
@@ -13697,7 +13697,7 @@ void MDCache::dispatch_quiesce_inode(const MDRequestRef& mdr)
       // as a result of the auth taking the above locks.
     }
 
-    if (!mds->locker->acquire_locks(mdr, lov, nullptr, {in}, false, true)) {
+    if (!mds->locker->acquire_locks(mdr, lov, nullptr, false, true)) {
       return;
     }
     mdr->locking_state |= MutationImpl::ALL_LOCKED;
@@ -14030,7 +14030,7 @@ void MDCache::dispatch_lock_path(const MDRequestRef& mdr)
     }
   }
 
-  if (!mds->locker->acquire_locks(mdr, lov, lps.config.ap_freeze ? in : nullptr, {in}, lps.config.ap_dont_block, true)) {
+  if (!mds->locker->acquire_locks(mdr, lov, lps.config.ap_freeze ? in : nullptr, lps.config.ap_dont_block, true)) {
     if (lps.config.ap_dont_block && mdr->aborted) {
       mds->server->respond_to_request(mdr, -CEPHFS_EWOULDBLOCK);
     }
index 681663cb65276d03def491721cbf1942d1e9b1d8..918cc4e613c1d3dd532848b3e849178a9921c8a0 100644 (file)
@@ -3105,7 +3105,7 @@ void Server::dispatch_peer_request(const MDRequestRef& mdr)
         // will want to take other locks is to prevent issuing unwanted client capabilities,
         // but since replicas can't issue capabilities, it should be fine allowing remote locks
         // without taking the quiesce lock.
-       if (!mds->locker->acquire_locks(mdr, lov, nullptr, {}, false, true))
+       if (!mds->locker->acquire_locks(mdr, lov, nullptr, false, true))
          return;
        
        // ack