monc: resubscribe on monitor connection reset

This commit is contained in:
Sage Weil 2009-08-31 14:38:22 -07:00
parent cdf683ca45
commit a0cc21dc66
4 changed files with 6 additions and 5 deletions

View File

@ -76,7 +76,7 @@ int main(int argc, const char **argv, const char *envp[]) {
rank.start();
rank.set_policy(entity_name_t::TYPE_MON, SimpleMessenger::Policy::lossy_fast_fail());
rank.set_policy(entity_name_t::TYPE_MON, SimpleMessenger::Policy::lossless());
rank.set_policy(entity_name_t::TYPE_MDS, SimpleMessenger::Policy::lossless());
rank.set_policy(entity_name_t::TYPE_OSD, SimpleMessenger::Policy::lossless());

View File

@ -59,7 +59,7 @@ int main(int argc, const char **argv, char *envp[])
rank.bind();
cout << "starting csyn at " << rank.get_rank_addr() << std::endl;
rank.set_policy(entity_name_t::TYPE_MON, SimpleMessenger::Policy::lossy_fast_fail());
rank.set_policy(entity_name_t::TYPE_MON, SimpleMessenger::Policy::lossless());
rank.set_policy(entity_name_t::TYPE_MDS, SimpleMessenger::Policy::lossless());
rank.set_policy(entity_name_t::TYPE_OSD, SimpleMessenger::Policy::lossless());

View File

@ -247,6 +247,7 @@ void MonClient::handle_mount_ack(MClientMountAck* m)
bufferlist::iterator p = m->monmap_bl.begin();
::decode(monmap, p);
messenger->_set_myaddr(m->addr);
messenger->reset_myname(entity_name_t::CLIENT(m->client));
// finish.
@ -279,9 +280,9 @@ void MonClient::pick_new_mon()
}
void MonClient::ms_handle_reset(const entity_addr_t& peer)
void MonClient::ms_handle_remote_reset(const entity_addr_t& peer)
{
dout(10) << "ms_handle_reset " << peer << dendl;
dout(10) << "ms_handle_peer_reset " << peer << dendl;
pick_new_mon();
renew_subs();
}

View File

@ -48,7 +48,7 @@ private:
bool ms_dispatch(Message *m);
void handle_monmap(MMonMap *m);
void ms_handle_reset(const entity_addr_t& peer);
void ms_handle_remote_reset(const entity_addr_t& peer);
protected:
class C_MountTimeout : public Context {