bdr: Consider a sequence vote successfull in more scenarios.
authorAndres Freund <andres@anarazel.de>
Mon, 18 Aug 2014 13:41:05 +0000 (15:41 +0200)
committerAndres Freund <andres@anarazel.de>
Mon, 8 Sep 2014 15:49:57 +0000 (17:49 +0200)
If either there's no nays or the number of yays is bigger than the
concensus the vote can be considered successful. We don't want to
always wait for a majority of yays, because that'd possibly delay
voting for a long time, even if enough nodes for a consensus on
another chunk are online.

bdr_seq.c

index f3730cdcbf206a19ca2a63ea221c9110c2c1a637..c1d7ccb0dd2d7a40a4d35d6d7b1116b93e97983d 100644 (file)
--- a/bdr_seq.c
+++ b/bdr_seq.c
@@ -372,7 +372,7 @@ const char *tally_elections_sql =
 "    UPDATE bdr_sequence_elections\n"
 "    SET\n"
 "        open = false,\n"
-"        success = (nays = 0)\n"
+"        success = (nays = 0 OR yays >= ceil($5/ 2.0))\n"
 "    FROM tallied_votes\n"
 "    WHERE\n"
 "       bdr_sequence_elections.owning_sysid = tallied_votes.owning_sysid\n"