Skip to content

Commit

Permalink
fixed proposer to override values only if the acceptor has accepted one
Browse files Browse the repository at this point in the history
  • Loading branch information
cocagne committed Jan 6, 2013
1 parent 254a061 commit a32748c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion paxos/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ def recv_promise(self, from_uid, proposal_id, prev_accepted_id, prev_accepted_va

if prev_accepted_id > self.last_accepted_id:
self.last_accepted_id = prev_accepted_id
self.proposed_value = prev_accepted_value
# Only override the current proposal value if the acceptor has
# accepted one. "None" is not a valid value
if prev_accepted_value is not None:
self.proposed_value = prev_accepted_value

if len(self.promises_rcvd) == self.quorum_size:
self.leader = True
Expand Down

0 comments on commit a32748c

Please sign in to comment.