From: Yan, Zheng Date: Sat, 2 Jun 2018 01:14:41 +0000 (+0800) Subject: Merge branch 'luminous' into wip-24049-luminous X-Git-Tag: v12.2.6~66^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e2ed5f440c0af11c2ca5bdc98785a556ab4a0f74;p=ceph.git Merge branch 'luminous' into wip-24049-luminous --- e2ed5f440c0af11c2ca5bdc98785a556ab4a0f74 diff --cc qa/tasks/cephfs/test_client_recovery.py index 68f04f6a6d90,f00a08355123..829ca3d5c6a8 --- a/qa/tasks/cephfs/test_client_recovery.py +++ b/qa/tasks/cephfs/test_client_recovery.py @@@ -475,36 -473,9 +475,41 @@@ class TestClientRecovery(CephFSTestCase self.mount_b.wait_until_mounted() self.mount_b.run_shell(["ls", "subdir/childfile"]) + def test_stale_renew(self): + if not isinstance(self.mount_a, FuseMount): + raise SkipTest("Require FUSE client to handle signal STOP/CONT") + - session_timeout = self.fs.get_var("session_timeout") - + self.mount_a.run_shell(["mkdir", "testdir"]) + self.mount_a.run_shell(["touch", "testdir/file1"]) + # populate readdir cache + self.mount_a.run_shell(["ls", "testdir"]) + self.mount_b.run_shell(["ls", "testdir"]) + + # check if readdir cache is effective + initial_readdirs = self.fs.mds_asok(['perf', 'dump', 'mds_server', 'req_readdir_latency']) + self.mount_b.run_shell(["ls", "testdir"]) + current_readdirs = self.fs.mds_asok(['perf', 'dump', 'mds_server', 'req_readdir_latency']) + self.assertEqual(current_readdirs, initial_readdirs); + + mount_b_gid = self.mount_b.get_global_id() + mount_b_pid = self.mount_b.get_client_pid() + # stop ceph-fuse process of mount_b + self.mount_b.client_remote.run(args=["sudo", "kill", "-STOP", mount_b_pid]) + + self.assert_session_state(mount_b_gid, "open") - time.sleep(session_timeout * 1.5) # Long enough for MDS to consider session stale ++ time.sleep(self.mds_session_timeout * 1.5) # Long enough for MDS to consider session stale + self.assert_session_state(mount_b_gid, "stale") + + self.mount_a.run_shell(["touch", "testdir/file2"]) + + # resume ceph-fuse process of mount_b + self.mount_b.client_remote.run(args=["sudo", "kill", "-CONT", mount_b_pid]) + # Is the new file visible from mount_b? (caps become invalid after session stale) + self.mount_b.run_shell(["ls", "testdir/file2"]) ++ + def test_unmount_for_evicted_client(self): + """Test if client hangs on unmount after evicting the client.""" + mount_a_client_id = self.mount_a.get_global_id() + self.fs.mds_asok(['session', 'evict', "%s" % mount_a_client_id]) + + self.mount_a.umount_wait(require_clean=True, timeout=30)