cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [1/2] git commit: Avoid rare duplicate read repair triggering
Date Wed, 29 Jan 2014 03:55:29 GMT
Updated Branches:
  refs/heads/trunk 918936600 -> a1ecb1246


Avoid rare duplicate read repair triggering

patch by Yang Wei; reviewed by Aleksey Yeschenko for CASSANDRA-6606


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

Branch: refs/heads/trunk
Commit: 09ab439b497e8f8db3eeff1db6559f0e6d1d34eb
Parents: d9f9c5b
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Tue Jan 28 21:50:20 2014 -0600
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Tue Jan 28 21:50:20 2014 -0600

----------------------------------------------------------------------
 CHANGES.txt                                             | 1 +
 src/java/org/apache/cassandra/service/ReadCallback.java | 8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/09ab439b/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 46b14fc..8e757b2 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -10,6 +10,7 @@
  * Don't special case received counts in CAS timeout exceptions (CASSANDRA-6595)
  * Add support for 2.1 global counter shards (CASSANDRA-6505)
  * Fix NPE when streaming connection is not yet established (CASSANDRA-6210)
+ * Avoid rare duplicate read repair triggering (CASSANDRA-6606)
 Merged from 1.2:
  * fsync compression metadata (CASSANDRA-6531)
  * Validate CF existence on execution for prepared statement (CASSANDRA-6535)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/09ab439b/src/java/org/apache/cassandra/service/ReadCallback.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/ReadCallback.java b/src/java/org/apache/cassandra/service/ReadCallback.java
index d665242..afff530 100644
--- a/src/java/org/apache/cassandra/service/ReadCallback.java
+++ b/src/java/org/apache/cassandra/service/ReadCallback.java
@@ -117,7 +117,7 @@ public class ReadCallback<TMessage, TResolved> implements IAsyncCallback<TMessag
         if (n >= blockfor && resolver.isDataPresent())
         {
             condition.signalAll();
-            maybeResolveForRepair();
+            maybeResolveForRepair(n);
         }
     }
 
@@ -151,11 +151,11 @@ public class ReadCallback<TMessage, TResolved> implements IAsyncCallback<TMessag
 
     /**
      * Check digests in the background on the Repair stage if we've received replies
-     * too all the requests we sent.
+     * to all the requests we sent.
      */
-    protected void maybeResolveForRepair()
+    protected void maybeResolveForRepair(int n)
     {
-        if (blockfor < endpoints.size() && received.get() == endpoints.size())
+        if (blockfor < endpoints.size() && n == endpoints.size())
         {
             assert resolver.isDataPresent();
             StageManager.getStage(Stage.READ_REPAIR).execute(new AsyncRepairRunner());


Mime
View raw message