summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhansong Gao <zhsgao@hotmail.com>2023-07-03 10:42:34 +0200
committerZhansong Gao <zhsgao@hotmail.com>2024-11-13 10:39:16 +0100
commitf23bd5d0995e4e52e0ac43c7e8a112cd2faf9f27 (patch)
treec4e27334a2265fa06de9ea68a5f28c37d772b018
parentmds: session in the importing state cannot be cleared if an export subtree ta... (diff)
downloadceph-f23bd5d0995e4e52e0ac43c7e8a112cd2faf9f27.tar.xz
ceph-f23bd5d0995e4e52e0ac43c7e8a112cd2faf9f27.zip
qa: add test for importer's unexpected client eviction after an export subtree task is interrupted
Signed-off-by: Zhansong Gao <zhsgao@hotmail.com>
-rw-r--r--qa/tasks/cephfs/filesystem.py2
-rw-r--r--qa/tasks/cephfs/test_exports.py24
2 files changed, 25 insertions, 1 deletions
diff --git a/qa/tasks/cephfs/filesystem.py b/qa/tasks/cephfs/filesystem.py
index 2b7fd2ee569..3846ef23f97 100644
--- a/qa/tasks/cephfs/filesystem.py
+++ b/qa/tasks/cephfs/filesystem.py
@@ -649,6 +649,8 @@ class FilesystemBase(MDSClusterBase):
def set_session_timeout(self, timeout):
self.set_var("session_timeout", "%d" % timeout)
+ def set_session_autoclose(self, autoclose_time):
+ self.set_var("session_autoclose", "%d" % autoclose_time)
def set_allow_standby_replay(self, yes):
self.set_var("allow_standby_replay", yes)
diff --git a/qa/tasks/cephfs/test_exports.py b/qa/tasks/cephfs/test_exports.py
index 49a67a8be18..346f139874b 100644
--- a/qa/tasks/cephfs/test_exports.py
+++ b/qa/tasks/cephfs/test_exports.py
@@ -789,4 +789,26 @@ class TestKillExports(CephFSTestCase):
self.wait_until_evicted(client_id, importer_rank)
# for multiple tests
- self.mount_a.remount() \ No newline at end of file
+ self.mount_a.remount()
+
+ def test_client_eviction(self):
+ # modify the timeout so that we don't have to wait too long
+ timeout = 30
+ self.fs.set_session_timeout(timeout)
+ self.fs.set_session_autoclose(timeout + 5)
+
+ kill_export_at = [9, 10]
+
+ exporter_rank = 0
+ importer_rank = 1
+
+ for kill in kill_export_at:
+ log.info(f"kill_export_at: {kill}")
+ self._run_kill_export(kill, exporter_rank, importer_rank)
+
+ client_id = self.mount_a.get_global_id()
+ self.wait_until_evicted(client_id, importer_rank, timeout + 10)
+ time.sleep(1)
+
+ # failed if buggy
+ self.mount_a.ls()