From: Venky Shankar Date: Thu, 15 Apr 2021 09:47:23 +0000 (-0400) Subject: cephfs-mirror: use sensible mount timeout when mounting local/remote fs X-Git-Tag: v17.1.0~1932^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=db4bade78cae576b98a61e1c15e609a650613f2a;p=ceph.git cephfs-mirror: use sensible mount timeout when mounting local/remote fs Signed-off-by: Venky Shankar --- diff --git a/src/common/options/cephfs-mirror.yaml.in b/src/common/options/cephfs-mirror.yaml.in index 7e8d773d9865..23166c11b8eb 100644 --- a/src/common/options/cephfs-mirror.yaml.in +++ b/src/common/options/cephfs-mirror.yaml.in @@ -80,3 +80,15 @@ options: services: - cephfs-mirror min: 0 +- name: cephfs_mirror_mount_timeout + type: secs + level: advanced + desc: timeout for mounting primary/seconday ceph file system + long_desc: Timeout in seconds for mounting primary or secondary (remote) ceph file system + by the cephfs-mirror daemon. Setting this to a higher value could result in the mirror + daemon getting stalled when mounting a file system if the cluster is not reachable. This + option is used to override the usual client_mount_timeout. + default: 10 + services: + - cephfs-mirror + min: 0 \ No newline at end of file diff --git a/src/tools/cephfs_mirror/Utils.cc b/src/tools/cephfs_mirror/Utils.cc index 617ae5ab4a61..733bfc9bf84b 100644 --- a/src/tools/cephfs_mirror/Utils.cc +++ b/src/tools/cephfs_mirror/Utils.cc @@ -108,6 +108,15 @@ int mount(RadosRef cluster, const Filesystem &filesystem, bool cross_check_fscid return r; } + // mount timeout applies for local and remote mounts. + auto mount_timeout = g_ceph_context->_conf.get_val + ("cephfs_mirror_mount_timeout").count(); + r = ceph_set_mount_timeout(cmi, mount_timeout); + if (r < 0) { + derr << ": mount error: " << cpp_strerror(r) << dendl; + return r; + } + r = ceph_init(cmi); if (r < 0) { derr << ": mount error: " << cpp_strerror(r) << dendl;