Repository: cassandra Updated Branches: refs/heads/trunk addba6b56 -> edcf9257e
Use CAS WriteType when replaying previous rounds in Paxos patch by Stefan Podkowinski; reviewed by slebresne for CASSANDRA-8672 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c8ab96d1 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c8ab96d1 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c8ab96d1 Branch: refs/heads/trunk Commit: c8ab96d1705c7b66b36eee3115d9d00bbe22aeab Parents: 38a04ea Author: Sylvain Lebresne <[email protected]> Authored: Wed Apr 1 21:27:00 2015 +0200 Committer: Sylvain Lebresne <[email protected]> Committed: Wed Apr 1 21:27:00 2015 +0200 ---------------------------------------------------------------------- CHANGES.txt | 2 ++ src/java/org/apache/cassandra/service/StorageProxy.java | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/c8ab96d1/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index fe1aa37..c569de5 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,6 @@ 2.0.15: + * Use the proper CAS WriteType when finishing a previous round during Paxos + preparation (CASSANDRA-8672) * Avoid race in cancelling compactions (CASSANDRA-9070) * More aggressive check for expired sstables in DTCS (CASSANDRA-8359) * Don't set clientMode to true when bulk-loading sstables to avoid http://git-wip-us.apache.org/repos/asf/cassandra/blob/c8ab96d1/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 d033929..aef59cf 100644 --- a/src/java/org/apache/cassandra/service/StorageProxy.java +++ b/src/java/org/apache/cassandra/service/StorageProxy.java @@ -379,7 +379,15 @@ public class StorageProxy implements StorageProxyMBean Commit refreshedInProgress = Commit.newProposal(inProgress.key, ballot, inProgress.update); if (proposePaxos(refreshedInProgress, liveEndpoints, requiredParticipants, false, consistencyForPaxos)) { - commitPaxos(refreshedInProgress, consistencyForCommit); + try + { + commitPaxos(refreshedInProgress, consistencyForCommit); + } + catch (WriteTimeoutException e) + { + // We're still doing preparation for the paxos rounds, so we want to use the CAS (see CASSANDRA-8672) + throw new WriteTimeoutException(WriteType.CAS, e.consistency, e.received, e.blockFor); + } } else {
