Skip to content

Instantly share code, notes, and snippets.

@zhouyuan
Created July 30, 2015 01:36
Show Gist options
  • Save zhouyuan/348547147ca69351368e to your computer and use it in GitHub Desktop.
Save zhouyuan/348547147ca69351368e to your computer and use it in GitHub Desktop.
diff --git a/src/ceph_fuse.cc b/src/ceph_fuse.cc
index 4dde417..0ef854e 100644
--- a/src/ceph_fuse.cc
+++ b/src/ceph_fuse.cc
@@ -209,6 +209,7 @@ int main(int argc, const char **argv, const char *envp[]) {
r = client->mount(g_conf->client_mountpoint.c_str());
if (r < 0) {
cerr << "ceph-fuse[" << getpid() << "]: ceph mount failed with " << cpp_strerror(-r) << std::endl;
+ cerr << "ceph-fuse[" << getpid() << "]: probably no MDS server is up?" << std::endl;
goto out_shutdown;
}
diff --git a/src/client/Client.cc b/src/client/Client.cc
index d4fb5a8..a0f203f 100644
--- a/src/client/Client.cc
+++ b/src/client/Client.cc
@@ -1491,14 +1491,21 @@ int Client::make_request(MetaRequest *request,
if (use_mds >= 0)
request->resend_mds = use_mds;
+ int tried = 0;
while (1) {
if (request->aborted)
break;
+ tried += 1;
+ if (tried > 1 && (mdsmap->get_num_up_mds() == 0)) {
+ ldout(cct, 10) << "no mds found, force abort" << dendl;
+ request->aborted = true;
+ continue;
+ }
+
// set up wait cond
Cond caller_cond;
request->caller_cond = &caller_cond;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment