Skip to content

Commit

Permalink
Wait for writes on synchronous read digest mismatch
Browse files Browse the repository at this point in the history
patch by Niklas Ekstrom; reviewed by jbellis and vijay for CASSANDRA-4792
  • Loading branch information
jbellis committed Oct 11, 2012
1 parent 4355aa8 commit 936302c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions 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)
Expand Down
8 changes: 5 additions & 3 deletions src/java/org/apache/cassandra/service/StorageProxy.java
Expand Up @@ -762,9 +762,6 @@ private static List<Row> fetchRows(List<ReadCommand> initialCommands, Consistenc
{
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
Expand All @@ -776,6 +773,11 @@ private static List<Row> fetchRows(List<ReadCommand> initialCommands, Consistenc
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)
{
Expand Down

0 comments on commit 936302c

Please sign in to comment.