#include "config.h"
-#include "handle.h"
+
+using std::vector;
// The config module maintains views. As a node joins or leaves a
// view, the next view will be the same as previous view, except with
LOG << "is " << mem << " still a member?";
if (!isamember(mem, newmem) && me != mem) {
LOG << "delete " << mem;
- handle(mem).invalidate();
+ rpcc::unbind_cached(mem);
}
}
}
// who has the smallest ID?
- string m = min(me, *min_element(cmems.begin(), cmems.end()));
+ string m = std::min(me, *std::min_element(cmems.begin(), cmems.end()));
if (m == me) {
// ping the other nodes
VERIFY(cfg_mutex_lock);
unsigned vid = my_view_id;
LOG << "heartbeat to " << m << " (" << vid << ")";
- handle h(m);
cfg_mutex_lock.unlock();
int r = 0, ret = rpc_protocol::bind_failure;
- if (rpcc *cl = h.safebind())
+ if (auto cl = rpcc::bind_cached(m))
ret = cl->call_timeout(paxos_protocol::heartbeat, milliseconds(100), r, me, vid);
cfg_mutex_lock.lock();
break;
case rpc_protocol::atmostonce_failure:
case rpc_protocol::oldsrv_failure:
- h.invalidate();
+ rpcc::unbind_cached(m);
break;
default:
LOG << "problem with " << m << " (" << ret << ") my vid " << vid << " his vid " << r;