Skip to content

Commit 4277cd2

Browse files
committed
mds: invalid id for client eviction is to be treated as success
Introduced-by: 0ef5941 Fixes: http://tracker.ceph.com/issues/68132 Signed-off-by: Venky Shankar <[email protected]>
1 parent 9bc0f19 commit 4277cd2

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

qa/tasks/cephfs/test_misc.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -558,16 +558,18 @@ def _evict_with_id_zero(self, cmd):
558558
self.assertEqual(ce.exception.exitstatus, errno.EINVAL)
559559

560560
def _evict_with_invalid_id(self, cmd):
561+
info_initial = self.fs.rank_asok(cmd + ['ls'])
561562
# with invalid id
562-
with self.assertRaises(CommandFailedError) as ce:
563-
self.fs.rank_tell(cmd + ['evict', 'id=1'])
564-
self.assertEqual(ce.exception.exitstatus, errno.ESRCH)
563+
self.fs.rank_tell(cmd + ['evict', 'id=1'])
564+
info = self.fs.rank_asok(cmd + ['ls'])
565+
self.assertEqual(len(info), len(info_initial)) # session list is status-quo
565566

566567
def _evict_with_negative_id(self, cmd):
568+
info_initial = self.fs.rank_asok(cmd + ['ls'])
567569
# with negative id
568-
with self.assertRaises(CommandFailedError) as ce:
569-
self.fs.rank_tell(cmd + ['evict', 'id=-9'])
570-
self.assertEqual(ce.exception.exitstatus, errno.ESRCH)
570+
self.fs.rank_tell(cmd + ['evict', 'id=-9'])
571+
info = self.fs.rank_asok(cmd + ['ls'])
572+
self.assertEqual(len(info), len(info_initial)) # session list is status-quo
571573

572574
def _evict_with_valid_id(self, cmd):
573575
info_initial = self.fs.rank_asok(cmd + ['ls'])

src/mds/MDSRank.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3149,7 +3149,7 @@ void MDSRankDispatcher::evict_clients(
31493149
dout(20) << __func__ << " matched " << victims.size() << " sessions" << dendl;
31503150

31513151
if (victims.empty()) {
3152-
on_finish(-ESRCH, "no hosts match", outbl);
3152+
on_finish(0, "no hosts match", outbl);
31533153
return;
31543154
}
31553155

0 commit comments

Comments
 (0)