]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge branch 'luminous' into wip-24049-luminous 22119/head
authorYan, Zheng <ukernel@gmail.com>
Sat, 2 Jun 2018 01:14:41 +0000 (09:14 +0800)
committerGitHub <noreply@github.com>
Sat, 2 Jun 2018 01:14:41 +0000 (09:14 +0800)
1  2 
qa/tasks/cephfs/fuse_mount.py
qa/tasks/cephfs/test_client_recovery.py
src/client/Client.cc

Simple merge
index 68f04f6a6d90fd1bb2ca1a5f05f9a92668a54fe9,f00a083551239bb8ffd485d3f0e1f6f26a2827ac..829ca3d5c6a8fc29f0dc234da5eaf8ee7023f0c3
@@@ -475,36 -473,9 +475,41 @@@ class TestClientRecovery(CephFSTestCase
          self.mount_b.wait_until_mounted()
          self.mount_b.run_shell(["ls", "subdir/childfile"])
  
-         session_timeout = self.fs.get_var("session_timeout")
 +    def test_stale_renew(self):
 +        if not isinstance(self.mount_a, FuseMount):
 +            raise SkipTest("Require FUSE client to handle signal STOP/CONT")
 +
-         time.sleep(session_timeout * 1.5)  # Long enough for MDS to consider session stale
 +        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(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)
Simple merge