paxos.cc
paxos_protocol::status
acceptor::decidereq(std::string src, paxos_protocol::decidearg a, int &r)
{
  ScopedLock ml(&pxs_mutex);
  tprintf("decidereq for accepted instance %d (my instance %d) v=%s\n", 
	 a.instance, instance_h, v_a.c_str());
  if (a.instance == instance_h + 1) {
    VERIFY(v_a == a.v);
    commit_wo(a.instance, v_a);
  } else if (a.instance <= instance_h) {
    // we are ahead ignore.
  } else {
    // we are behind
    VERIFY(0);
  }
  return paxos_protocol::OK;
}
// the src argument is only for debug purpose
the src argument is only for debug purpose
the src argument is only for debug purpose
paxos_protocol::status
acceptor::decidereq(std::string src, paxos_protocol::decidearg a, int &r)
{
  ScopedLock ml(&pxs_mutex);
  tprintf("decidereq for accepted instance %d (my instance %d) v=%s\n", 
	 a.instance, instance_h, v_a.c_str());
  if (a.instance == instance_h + 1) {
    VERIFY(v_a == a.v);
    commit_wo(a.instance, v_a);
  } else if (a.instance <= instance_h) {
  } else {
    VERIFY(0);
  }
  return paxos_protocol::OK;
}
paxos_protocol :: status acceptor :: decidereq ( std :: string src , paxos_protocol :: decidearg a , int & r ) { ScopedLock ml ( & pxs_mutex ) ; tprintf ( " \n " , a . instance , instance_h , v_a . c_str ( ) ) ; if ( a . instance == instance_h + 1 ) { VERIFY ( v_a == a . v ) ; commit_wo ( a . instance , v_a ) ; } else if ( a . instance <= instance_h ) { } else { VERIFY ( 0 ) ; } return paxos_protocol :: OK ; }
the src argument is only for debug purpose
the src argument is only for debug purpose
// we are ahead ignore. // we are behind