]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs-mirror: use sensible mount timeout when mounting local/remote fs
authorVenky Shankar <vshankar@redhat.com>
Thu, 15 Apr 2021 09:47:23 +0000 (05:47 -0400)
committerVenky Shankar <vshankar@redhat.com>
Tue, 4 May 2021 04:58:46 +0000 (00:58 -0400)
Signed-off-by: Venky Shankar <vshankar@redhat.com>
src/common/options/cephfs-mirror.yaml.in
src/tools/cephfs_mirror/Utils.cc

index 7e8d773d9865b32c5bd98d9f29e981a8fd55c542..23166c11b8ebad44784328f46b99f10c88271a64 100644 (file)
@@ -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
index 617ae5ab4a61e624dcc2e061f2655e814d52305f..733bfc9bf84be849a496ffafac2de90f2ca81103 100644 (file)
@@ -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<std::chrono::seconds>
+    ("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;