You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sl...@apache.org on 2011/06/14 11:46:25 UTC

svn commit: r1135441 - in /cassandra/branches/cassandra-0.8: CHANGES.txt src/java/org/apache/cassandra/service/AntiEntropyService.java

Author: slebresne
Date: Tue Jun 14 09:46:25 2011
New Revision: 1135441

URL: http://svn.apache.org/viewvc?rev=1135441&view=rev
Log:
Fix ConcurrentModificationException in repair
patch by slebresne; reviewed by jbellis for CASSANDRA-2767

Modified:
    cassandra/branches/cassandra-0.8/CHANGES.txt
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/AntiEntropyService.java

Modified: cassandra/branches/cassandra-0.8/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/CHANGES.txt?rev=1135441&r1=1135440&r2=1135441&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.8/CHANGES.txt Tue Jun 14 09:46:25 2011
@@ -53,6 +53,8 @@
    in multithreaded compaction (CASSANDRA-2765)
  * seek back after deserializing a row to update cache with (CASSANDRA-2752)
  * avoid skipping rows in scrub for counter column family (CASSANDRA-2759)
+ * fix ConcurrentModificationException in repair when dealing with 0.7 node
+   (CASSANDRA-2767)
 
 
 0.8.0-final

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/AntiEntropyService.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/AntiEntropyService.java?rev=1135441&r1=1135440&r2=1135441&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/AntiEntropyService.java (original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/AntiEntropyService.java Tue Jun 14 09:46:25 2011
@@ -170,12 +170,14 @@ public class AntiEntropyService
         neighbors.remove(FBUtilities.getLocalAddress());
         // Excluding all node with version <= 0.7 since they don't know how to
         // create a correct merkle tree (they build it over the full range)
-        for (InetAddress endpoint : neighbors)
+        Iterator<InetAddress> iter = neighbors.iterator();
+        while (iter.hasNext())
         {
+            InetAddress endpoint = iter.next();
             if (Gossiper.instance.getVersion(endpoint) <= MessagingService.VERSION_07)
             {
                 logger.info("Excluding " + endpoint + " from repair because it is on version 0.7 or sooner. You should consider updating this node before running repair again.");
-                neighbors.remove(endpoint);
+                iter.remove();
             }
         }
         return neighbors;