]> 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>
Thu, 27 May 2021 13:35:21 +0000 (09:35 -0400)
Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit db4bade78cae576b98a61e1c15e609a650613f2a)

 Conflicts:
src/common/options/cephfs-mirror.yaml.in

cephfs-mirror.yaml.in does not exist in pacific -- use src/common/options.cc
to detail the configuration.

src/common/options.cc
src/tools/cephfs_mirror/Utils.cc

index 8e3501e6232974bc6d8de550f4eb9fc322549eb2..a6dfd9b606725874691833e092e437b627ab0a7e 100644 (file)
@@ -9153,6 +9153,12 @@ std::vector<Option> get_cephfs_mirror_options() {
     .set_min(0)
     .set_description("interval to restart failed mirror instances")
     .set_long_description("Interval in seconds to restart failed mirror instances. Setting to zero (0) disables restarting failed mirror instances."),
+
+    Option("cephfs_mirror_mount_timeout", Option::TYPE_SECS, Option::LEVEL_ADVANCED)
+    .set_default(10)
+    .set_min(0)
+    .set_description("timeout for mounting primary/seconday ceph file system")
+    .set_long_description("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."),
     });
 }
 
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;