Skip to content

Commit d31541d

Browse files
committed
Merge PR ceph#59874 into main
* refs/pull/59874/head: mds: invalid id for client eviction is to be treated as success Reviewed-by: Neeraj Pratap Singh <[email protected]>
2 parents 41f803a + 4277cd2 commit d31541d

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
@@ -3107,7 +3107,7 @@ void MDSRankDispatcher::evict_clients(
31073107
dout(20) << __func__ << " matched " << victims.size() << " sessions" << dendl;
31083108

31093109
if (victims.empty()) {
3110-
on_finish(-ESRCH, "no hosts match", outbl);
3110+
on_finish(0, "no hosts match", outbl);
31113111
return;
31123112
}
31133113

0 commit comments

Comments
 (0)