From b78972404f4b0a5dbccb6849021c2ca2d5e8bb46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20=C3=98rbekk?= Date: Tue, 24 Apr 2012 15:00:56 +0200 Subject: Fix off-by-one error in MasterProposer. --- same/src/main/java/com/orbekk/paxos/MasterProposer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'same') diff --git a/same/src/main/java/com/orbekk/paxos/MasterProposer.java b/same/src/main/java/com/orbekk/paxos/MasterProposer.java index bc4f18d..048995e 100644 --- a/same/src/main/java/com/orbekk/paxos/MasterProposer.java +++ b/same/src/main/java/com/orbekk/paxos/MasterProposer.java @@ -66,7 +66,7 @@ public class MasterProposer extends Thread { private void checkDone() { if (done.getCount() > 0) { - if (numPromises.get() >= numRequests / 2) { + if (numPromises.get() > numRequests / 2) { result.set(proposalNumber); done.countDown(); } else if (numResponses.get() >= numRequests) { -- cgit v1.2.3