Permalink
Browse files

Wait for writes on synchronous read digest mismatch

patch by Niklas Ekstrom; reviewed by jbellis and vijay for CASSANDRA-4792
  • Loading branch information...
1 parent 4355aa8 commit 936302cb3876df87e6afb45c775850eb851e9b18 @jbellis jbellis committed Oct 11, 2012
Showing with 6 additions and 3 deletions.
  1. +1 −0 CHANGES.txt
  2. +5 −3 src/java/org/apache/cassandra/service/StorageProxy.java
View
@@ -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)
@@ -762,9 +762,6 @@ public void runMayThrow() throws IOException, TimeoutException
{
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 void runMayThrow() throws IOException, TimeoutException
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)
{

0 comments on commit 936302c

Please sign in to comment.