From: Sage Weil Date: Thu, 17 Sep 2009 21:56:34 +0000 (-0700) Subject: monc: pick monitor before sending initial mount X-Git-Tag: v0.15~46 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b780d54597ae83e8ca7f8b6bd4ae1f06e4c2e153;p=ceph.git monc: pick monitor before sending initial mount --- diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index c8c03a3c712..5dcc824e137 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -109,7 +109,8 @@ int MonClient::get_monmap() Mutex::Locker l(monc_lock); want_monmap = true; - _reopen_session(); + if (cur_mon < 0) + _reopen_session(); while (want_monmap) map_cond.Wait(monc_lock); @@ -244,9 +245,12 @@ int MonClient::mount(double mount_timeout) } // only first mounter does the work - if (!mounting) - _send_mount(); mounting++; + if (mounting == 1) { + if (cur_mon < 0) + _reopen_session(); + _send_mount(); + } while (clientid < 0 && !mount_err) mount_cond.Wait(monc_lock); mounting--; @@ -281,6 +285,7 @@ void MonClient::handle_mount_ack(MClientMountAck* m) void MonClient::_send_mon_message(Message *m) { + assert(cur_mon >= 0); messenger->send_message(m, monmap.mon_inst[cur_mon]); } @@ -363,6 +368,8 @@ void MonClient::_renew_subs() MMonSubscribe *m = new MMonSubscribe; m->what = sub_have; + if (cur_mon < 0) + _reopen_session(); _send_mon_message(m); }