Merge branch 'cassandra-3.11' into trunk

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

Branch: refs/heads/trunk
Commit: 50ba850beb573ae4aa62ac46e645ce48413815ce
Parents: b687641 4d24958
Author: Paulo Motta <pa...@apache.org>
Authored: Thu Apr 20 10:40:22 2017 -0300
Committer: Paulo Motta <pa...@apache.org>
Committed: Thu Apr 20 10:48:37 2017 -0300

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../cassandra/service/ActiveRepairService.java  | 21 ++++++++++++--------
 2 files changed, 14 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/50ba850b/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index db863e1,08df2dd..2710060
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -80,7 -24,9 +80,8 @@@
   * NoReplicationTokenAllocator should work with zero replication factor 
(CASSANDRA-12983)
   * Address message coalescing regression (CASSANDRA-12676)
   * Delete illegal character from StandardTokenizerImpl.jflex (CASSANDRA-13417)
 - * Fix cqlsh automatic protocol downgrade regression (CASSANDRA-13307)
  Merged from 3.0:
+  * Fail repair if insufficient responses received (CASSANDRA-13397)
   * Fix SSTableLoader fail when the loaded table contains dropped columns 
(CASSANDRA-13276)
   * Avoid name clashes in CassandraIndexTest (CASSANDRA-13427)
   * Handling partially written hint files (CASSANDRA-12728)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/50ba850b/src/java/org/apache/cassandra/service/ActiveRepairService.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/service/ActiveRepairService.java
index 381af48,fea690e..c03c470
--- a/src/java/org/apache/cassandra/service/ActiveRepairService.java
+++ b/src/java/org/apache/cassandra/service/ActiveRepairService.java
@@@ -358,14 -324,17 +358,16 @@@ public class ActiveRepairService implem
              }
              else
              {
-                 status.set(false);
-                 failedNodes.add(neighbour.getHostAddress());
-                 prepareLatch.countDown();
+                 // bailout early to avoid potentially waiting for a long time.
+                 failRepair(parentRepairSession, "Endpoint not alive: " + 
neighbour);
              }
          }
 -
          try
          {
-             prepareLatch.await(DatabaseDescriptor.getRpcTimeout(), 
TimeUnit.MILLISECONDS);
+             // Failed repair is expensive so we wait for longer time.
+             if (!prepareLatch.await(1, TimeUnit.HOURS)) {
+                 failRepair(parentRepairSession, "Did not get replies from all 
endpoints.");
+             }
          }
          catch (InterruptedException e)
          {
@@@ -382,9 -349,13 +382,14 @@@
          return parentRepairSession;
      }
  
+     private void failRepair(UUID parentRepairSession, String errorMsg) {
+         removeParentRepairSession(parentRepairSession);
+         throw new RuntimeException(errorMsg);
+     }
+ 
 -    public void registerParentRepairSession(UUID parentRepairSession, 
InetAddress coordinator, List<ColumnFamilyStore> columnFamilyStores, 
Collection<Range<Token>> ranges, boolean isIncremental, long timestamp, boolean 
isGlobal)
 +    public void registerParentRepairSession(UUID parentRepairSession, 
InetAddress coordinator, List<ColumnFamilyStore> columnFamilyStores, 
Collection<Range<Token>> ranges, boolean isIncremental, long repairedAt, 
boolean isGlobal)
      {
 +        assert isIncremental || repairedAt == 
ActiveRepairService.UNREPAIRED_SSTABLE;
          if (!registeredForEndpointChanges)
          {
              Gossiper.instance.register(this);

Reply via email to