int ret = active_con->authenticate(m);
m->put();
std::swap(auth, active_con->get_auth());
+ if (global_id != active_con->get_global_id()) {
+ lderr(cct) << __func__ << " peer assigned me a different global_id: "
+ << active_con->get_global_id() << dendl;
+ }
if (ret != -EAGAIN) {
_finish_auth(ret);
}
log_client->reset_session();
send_log();
}
- if (active_con)
+ if (active_con) {
std::swap(auth, active_con->get_auth());
+ global_id = active_con->get_global_id();
+ }
}
_finish_auth(auth_err);
if (!auth_err) {
assert(monc_lock.is_locked());
ldout(cct, 10) << __func__ << " rank " << rank << dendl;
- // save global_id if any before nuking active_con
- const uint64_t global_id = active_con ? active_con->get_global_id() : 0;
active_con.reset();
pending_cons.clear();
// authenticate
std::unique_ptr<AuthClientHandler> auth;
uint32_t want_keys = 0;
+ uint64_t global_id = 0;
Cond auth_cond;
int authenticate_err = 0;
uint64_t get_global_id() const {
Mutex::Locker l(monc_lock);
- if (active_con) {
- return active_con->get_global_id();
- } else {
- return 0;
- }
+ return global_id;
}
void set_messenger(Messenger *m) { messenger = m; }