cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [3/5] git commit: fix re-propose of earlier, incomplete paxos round to use new ballot patch by jbellis; reviewed by slebresne for CASSANDRA-5985
Date Mon, 09 Sep 2013 22:11:30 GMT
fix re-propose of earlier, incomplete paxos round to use new ballot
patch by jbellis; reviewed by slebresne for CASSANDRA-5985


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/04cd81cd
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/04cd81cd
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/04cd81cd

Branch: refs/heads/trunk
Commit: 04cd81cdbb16e4f64b950325b581c6ba573b14a8
Parents: 41798b6
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Sun Sep 8 23:41:24 2013 +0100
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Mon Sep 9 23:10:57 2013 +0100

----------------------------------------------------------------------
 .../org/apache/cassandra/service/StorageProxy.java     | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/04cd81cd/src/java/org/apache/cassandra/service/StorageProxy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageProxy.java b/src/java/org/apache/cassandra/service/StorageProxy.java
index 9af310d..50dfd07 100644
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@ -382,8 +382,17 @@ public class StorageProxy implements StorageProxyMBean
             if (!inProgress.update.isEmpty() && inProgress.isAfter(mostRecent))
             {
                 Tracing.trace("Finishing incomplete paxos round {}", inProgress);
-                if (proposePaxos(inProgress, liveEndpoints, requiredParticipants))
-                    commitPaxos(inProgress, ConsistencyLevel.QUORUM);
+                Commit refreshedInProgress = Commit.newProposal(inProgress.key, ballot, inProgress.update);
+                if (proposePaxos(refreshedInProgress, liveEndpoints, requiredParticipants))
+                {
+                    commitPaxos(refreshedInProgress, ConsistencyLevel.QUORUM);
+                }
+                else
+                {
+                    Tracing.trace("Some replicas have already promised a higher ballot than
ours; aborting");
+                    // sleep a random amount to give the other proposer a chance to finish
+                    Uninterruptibles.sleepUninterruptibly(FBUtilities.threadLocalRandom().nextInt(100),
TimeUnit.MILLISECONDS);
+                }
                 continue;
             }
 


Mime
View raw message