projects
/
invirt/third/libt4.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RPC procedures are now identified via a struct containing a string name.
[invirt/third/libt4.git]
/
config.cc
diff --git
a/config.cc
b/config.cc
index
e1b0963
..
8a7bf65
100644
(file)
--- a/
config.cc
+++ b/
config.cc
@@
-1,5
+1,6
@@
#include "config.h"
#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
// 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
@@
-36,7
+37,7
@@
config_view_change::~config_view_change() {}
config::config(const string & _first, const string & _me, config_view_change *_vc)
config_view_change::~config_view_change() {}
config::config(const string & _first, const string & _me, config_view_change *_vc)
- : my_view_id(0), first(_first), me(_me), vc(_vc),
+ : first(_first), me(_me), vc(_vc),
paxos(this, me == _first, me, me)
{
get_rpcs()->reg(paxos_protocol::heartbeat, &config::heartbeat, this);
paxos(this, me == _first, me, me)
{
get_rpcs()->reg(paxos_protocol::heartbeat, &config::heartbeat, this);
@@
-83,7
+84,7
@@
void config::paxos_commit(unsigned instance, const string & value) {
LOG << "is " << mem << " still a member?";
if (!isamember(mem, newmem) && me != mem) {
LOG << "delete " << mem;
LOG << "is " << mem << " still a member?";
if (!isamember(mem, newmem) && me != mem) {
LOG << "delete " << mem;
- handle(mem).invalidate();
+ rpcc::unbind_cached(mem);
}
}
}
}
@@
-196,11
+197,10
@@
config::heartbeat_t config::doheartbeat(const string & m, lock & cfg_mutex_lock)
VERIFY(cfg_mutex_lock);
unsigned vid = my_view_id;
LOG << "heartbeat to " << m << " (" << vid << ")";
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;
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();
ret = cl->call_timeout(paxos_protocol::heartbeat, milliseconds(100), r, me, vid);
cfg_mutex_lock.lock();
@@
-210,7
+210,7
@@
config::heartbeat_t config::doheartbeat(const string & m, lock & cfg_mutex_lock)
break;
case rpc_protocol::atmostonce_failure:
case rpc_protocol::oldsrv_failure:
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;
break;
default:
LOG << "problem with " << m << " (" << ret << ") my vid " << vid << " his vid " << r;