Wait for writes on synchronous read digest mismatch patch by Niklas Ekstrom; reviewed by jbellis and vijay for CASSANDRA-4792
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/936302cb Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/936302cb Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/936302cb Branch: refs/heads/cassandra-1.1 Commit: 936302cb3876df87e6afb45c775850eb851e9b18 Parents: 4355aa8 Author: Jonathan Ellis <[email protected]> Authored: Thu Oct 11 15:05:40 2012 -0500 Committer: Jonathan Ellis <[email protected]> Committed: Thu Oct 11 15:05:40 2012 -0500 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../org/apache/cassandra/service/StorageProxy.java | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/936302cb/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 40cd7b4..1a37b8e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 1.1.6 + * Wait for writes on synchronous read digest mismatch (CASSANDRA-4792) * fix commitlog replay for nanotime-infected sstables (CASSANDRA-4782) * preflight check ttl for maximum of 20 years (CASSANDRA-4771) * (Pig) fix widerow input with single column rows (CASSANDRA-4789) http://git-wip-us.apache.org/repos/asf/cassandra/blob/936302cb/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 bc45e84..14466ee 100644 --- a/src/java/org/apache/cassandra/service/StorageProxy.java +++ b/src/java/org/apache/cassandra/service/StorageProxy.java @@ -762,9 +762,6 @@ public class StorageProxy implements StorageProxyMBean { ReadCommand command = repairCommands.get(i); RepairCallback handler = repairResponseHandlers.get(i); - // wait for the repair writes to be acknowledged, to minimize impact on any replica that's - // behind on writes in case the out-of-sync row is read multiple times in quick succession - FBUtilities.waitOnFutures(handler.resolver.repairResults, DatabaseDescriptor.getRpcTimeout()); Row row; try @@ -776,6 +773,11 @@ public class StorageProxy implements StorageProxyMBean throw new AssertionError(e); // full data requested from each node here, no digests should be sent } + // wait for the repair writes to be acknowledged, to minimize impact on any replica that's + // behind on writes in case the out-of-sync row is read multiple times in quick succession + FBUtilities.waitOnFutures(handler.resolver.repairResults, DatabaseDescriptor.getRpcTimeout()); + + // retry any potential short reads ReadCommand retryCommand = command.maybeGenerateRetryCommand(handler, row); if (retryCommand != null) {
