mirror of
https://github.com/ceph/ceph
synced 2025-03-05 15:58:41 +00:00
msgr: Remove the SimpleMessenger::bind() nonce parameter.
Instead, use the just-established nonce value. Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
This commit is contained in:
parent
ef244773ee
commit
578bc9c420
@ -71,8 +71,8 @@ static int do_cmds_special_action(const std::string &action,
|
||||
common_init_finish(g_ceph_context);
|
||||
SimpleMessenger *messenger = new SimpleMessenger(g_ceph_context,
|
||||
entity_name_t::CLIENT());
|
||||
int r = messenger->bind(g_conf->public_addr, getpid());
|
||||
messenger->set_nonce(getpid());
|
||||
int r = messenger->bind(g_conf->public_addr);
|
||||
if (r < 0)
|
||||
return r;
|
||||
MonClient mc(g_ceph_context);
|
||||
@ -234,8 +234,9 @@ int main(int argc, const char **argv)
|
||||
SimpleMessenger *messenger = new SimpleMessenger(g_ceph_context,
|
||||
entity_name_t::MDS(-1));
|
||||
messenger->set_cluster_protocol(CEPH_MDS_PROTOCOL);
|
||||
messenger->set_nonce(getpid());
|
||||
|
||||
int r = messenger->bind(g_conf->public_addr, getpid());
|
||||
int r = messenger->bind(g_conf->public_addr);
|
||||
if (r < 0)
|
||||
exit(1);
|
||||
|
||||
|
@ -379,7 +379,7 @@ int main(int argc, const char **argv)
|
||||
<< " fsid " << monmap.get_fsid()
|
||||
<< std::endl;
|
||||
|
||||
err = messenger->bind(ipaddr, 0);
|
||||
err = messenger->bind(ipaddr);
|
||||
if (err < 0)
|
||||
return 1;
|
||||
|
||||
|
@ -301,18 +301,21 @@ int main(int argc, const char **argv)
|
||||
}
|
||||
|
||||
SimpleMessenger *client_messenger = new SimpleMessenger(g_ceph_context, entity_name_t::OSD(whoami));
|
||||
client_messenger->set_nonce(getpid());
|
||||
SimpleMessenger *cluster_messenger = new SimpleMessenger(g_ceph_context, entity_name_t::OSD(whoami));
|
||||
cluster_messenger->set_nonce(getpid());
|
||||
SimpleMessenger *messenger_hbin = new SimpleMessenger(g_ceph_context,entity_name_t::OSD(whoami));
|
||||
messenger_hbin->set_nonce(getpid());
|
||||
SimpleMessenger *messenger_hbout = new SimpleMessenger(g_ceph_context, entity_name_t::OSD(whoami));
|
||||
messenger_hbout->set_nonce(getpid());
|
||||
cluster_messenger->set_cluster_protocol(CEPH_OSD_PROTOCOL);
|
||||
messenger_hbin->set_cluster_protocol(CEPH_OSD_PROTOCOL);
|
||||
messenger_hbin->set_nonce(getpid());
|
||||
messenger_hbout->set_cluster_protocol(CEPH_OSD_PROTOCOL);
|
||||
|
||||
r = client_messenger->bind(g_conf->public_addr, getpid());
|
||||
r = client_messenger->bind(g_conf->public_addr);
|
||||
if (r < 0)
|
||||
exit(1);
|
||||
r = cluster_messenger->bind(g_conf->cluster_addr, getpid());
|
||||
r = cluster_messenger->bind(g_conf->cluster_addr);
|
||||
if (r < 0)
|
||||
exit(1);
|
||||
|
||||
@ -320,7 +323,7 @@ int main(int argc, const char **argv)
|
||||
entity_addr_t hb_addr = g_conf->cluster_addr;
|
||||
if (!hb_addr.is_blank_ip())
|
||||
hb_addr.set_port(0);
|
||||
r = messenger_hbout->bind(hb_addr, getpid());
|
||||
r = messenger_hbout->bind(hb_addr);
|
||||
if (r < 0)
|
||||
exit(1);
|
||||
|
||||
|
@ -69,7 +69,8 @@ int main(int argc, const char **argv, char *envp[])
|
||||
cout << "ceph-syn: starting " << g_conf->num_client << " syn client(s)" << std::endl;
|
||||
for (int i=0; i<g_conf->num_client; i++) {
|
||||
messengers[i] = new SimpleMessenger(g_ceph_context, entity_name_t(entity_name_t::TYPE_CLIENT,-1));
|
||||
messengers[i]->bind(g_conf->public_addr, i * 1000000 + getpid());
|
||||
messengers[i]->set_nonce(i * 1000000 + getpid());
|
||||
messengers[i]->bind(g_conf->public_addr);
|
||||
mclients[i] = new MonClient(g_ceph_context);
|
||||
mclients[i]->build_initial_monmap();
|
||||
Client *client = new Client(messengers[i], mclients[i]);
|
||||
|
@ -2380,7 +2380,7 @@ void SimpleMessenger::queue_reap(Pipe *pipe)
|
||||
|
||||
|
||||
|
||||
int SimpleMessenger::bind(entity_addr_t bind_addr, int64_t nonce)
|
||||
int SimpleMessenger::bind(entity_addr_t bind_addr)
|
||||
{
|
||||
lock.Lock();
|
||||
if (started) {
|
||||
|
@ -529,7 +529,7 @@ public:
|
||||
delete dispatch_queue.local_pipe;
|
||||
}
|
||||
|
||||
int bind(entity_addr_t bind_addr, int64_t nonce);
|
||||
int bind(entity_addr_t bind_addr);
|
||||
virtual int start();
|
||||
virtual void wait();
|
||||
|
||||
|
@ -98,7 +98,8 @@ int main(int argc, const char **argv, const char *envp[]) {
|
||||
g_ceph_context->_conf->apply_changes(NULL);
|
||||
SimpleMessenger *rank = new SimpleMessenger(g_ceph_context,
|
||||
entity_name_t::MON(whoami));
|
||||
int err = rank->bind(g_ceph_context->_conf->public_addr, getpid());
|
||||
rank->set_nonce(getpid());
|
||||
int err = rank->bind(g_ceph_context->_conf->public_addr);
|
||||
if (err < 0)
|
||||
return 1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user