]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: invalid id for client eviction is to be treated as success 60059/head
authorVenky Shankar <vshankar@redhat.com>
Thu, 19 Sep 2024 06:27:53 +0000 (06:27 +0000)
committerVenky Shankar <vshankar@redhat.com>
Mon, 30 Sep 2024 12:42:38 +0000 (18:12 +0530)
Introduced-by: 0ef5941a2e79
Fixes: http://tracker.ceph.com/issues/68132
Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit 4277cd298977c606609b90e2c2fa367cce97ae5a)

qa/tasks/cephfs/test_misc.py
src/mds/MDSRank.cc

index 7c5b517d81f6e758a88b1bcde23fa1e41ca8627d..ccd0c527160a252ed6bb0ca2f1a85113c6d49e74 100644 (file)
@@ -553,16 +553,18 @@ class TestSessionClientEvict(CephFSTestCase):
         self.assertEqual(ce.exception.exitstatus, errno.EINVAL)
 
     def _evict_with_invalid_id(self, cmd):
+        info_initial = self.fs.rank_asok(cmd + ['ls'])
         # with invalid id
-        with self.assertRaises(CommandFailedError) as ce:
-            self.fs.rank_tell(cmd + ['evict', 'id=1'])
-        self.assertEqual(ce.exception.exitstatus, errno.ESRCH)
+        self.fs.rank_tell(cmd + ['evict', 'id=1'])
+        info = self.fs.rank_asok(cmd + ['ls'])
+        self.assertEqual(len(info), len(info_initial)) # session list is status-quo
 
     def _evict_with_negative_id(self, cmd):
+        info_initial = self.fs.rank_asok(cmd + ['ls'])
         # with negative id
-        with self.assertRaises(CommandFailedError) as ce:
-            self.fs.rank_tell(cmd + ['evict', 'id=-9'])
-        self.assertEqual(ce.exception.exitstatus, errno.ESRCH)
+        self.fs.rank_tell(cmd + ['evict', 'id=-9'])
+        info = self.fs.rank_asok(cmd + ['ls'])
+        self.assertEqual(len(info), len(info_initial)) # session list is status-quo
 
     def _evict_with_valid_id(self, cmd):
         info_initial = self.fs.rank_asok(cmd + ['ls'])
index c766e9ef1f982aa5ed29c0bfc44af68607d1f425..9d0d97028e7b0a653a1d0d1acc34d038304f0ee4 100644 (file)
@@ -3135,7 +3135,7 @@ void MDSRankDispatcher::evict_clients(
   dout(20) << __func__ << " matched " << victims.size() << " sessions" << dendl;
 
   if (victims.empty()) {
-    on_finish(-ESRCH, "no hosts match", outbl);
+    on_finish(0, "no hosts match", outbl);
     return;
   }