bool r = false;
proposal.n = max(promise.n, proposal.n) + 1;
nodes_t accepts;
- value_t v = newv;
+ value_t v;
if (prepare(instance, accepts, cur_nodes, v)) {
if (majority(cur_nodes, accepts)) {
LOG("received a majority of prepare responses");
+ if (!v.size())
+ v = newv;
+
breakpoint1();
nodes_t nodes;
}
void proposer_acceptor::commit(unsigned instance, const value_t & value, lock & pxs_mutex_lock) {
- LOG("acceptor::commit: instance=" << instance << " has v=" << value);
+ LOG("instance=" << instance << " has v=" << value);
if (instance > instance_h) {
- LOG("commit: highestacceptedinstance = " << instance);
+ LOG("highestacceptedinstance = " << instance);
values[instance] = value;
l.loginstance(instance, value);
instance_h = instance;
accepted = promise = {0, me};
- accepted_value.clear();
+ string v = value; // gaaahhh aliasing of value and accepted_value
+ accepted_value.clear(); // this wipes out "value", too
if (delegate) {
pxs_mutex_lock.unlock();
- delegate->paxos_commit(instance, value);
+ delegate->paxos_commit(instance, v);
pxs_mutex_lock.lock();
}
}