Skip to content

Commit

Permalink
Merge PR ceph#59874 into main
Browse files Browse the repository at this point in the history
* refs/pull/59874/head:
	mds: invalid id for client eviction is to be treated as success

Reviewed-by: Neeraj Pratap Singh <[email protected]>
  • Loading branch information
vshankar committed Sep 30, 2024
2 parents 41f803a + 4277cd2 commit d31541d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions qa/tasks/cephfs/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,16 +558,18 @@ def _evict_with_id_zero(self, cmd):
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'])
Expand Down
2 changes: 1 addition & 1 deletion src/mds/MDSRank.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3107,7 +3107,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;
}

Expand Down

0 comments on commit d31541d

Please sign in to comment.