cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject svn commit: r1094796 - /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AntiEntropyService.java
Date Mon, 18 Apr 2011 22:16:29 GMT
Author: slebresne
Date: Mon Apr 18 22:16:29 2011
New Revision: 1094796

URL: http://svn.apache.org/viewvc?rev=1094796&view=rev
Log:
Check for dead neighbors before starting repair
patch by slebresne; reviewed by jbellis for CASSANDRA-2290

Modified:
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AntiEntropyService.java

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AntiEntropyService.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AntiEntropyService.java?rev=1094796&r1=1094795&r2=1094796&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AntiEntropyService.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AntiEntropyService.java
Mon Apr 18 22:16:29 2011
@@ -39,6 +39,7 @@ import org.apache.cassandra.db.Decorated
 import org.apache.cassandra.db.Table;
 import org.apache.cassandra.dht.Range;
 import org.apache.cassandra.dht.Token;
+import org.apache.cassandra.gms.FailureDetector;
 import org.apache.cassandra.io.AbstractCompactedRow;
 import org.apache.cassandra.io.ICompactSerializer;
 import org.apache.cassandra.io.sstable.SSTableReader;
@@ -753,6 +754,16 @@ public class AntiEntropyService
                 return;
             }
 
+            // Checking all nodes are live
+            for (InetAddress endpoint : endpoints)
+            {
+                if (!FailureDetector.instance.isAlive(endpoint))
+                {
+                    logger.info("Could not proceed on repair because a neighbor (" + endpoint
+ ") is dead: " + getName() + " failed.");
+                    return;
+                }
+            }
+
             // begin a repair session
             Callback callback = new Callback();
             AntiEntropyService.this.sessions.put(getName(), callback);



Mime
View raw message