cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasobr...@apache.org
Subject [1/2] git commit: Gossiper.addSavedEndpoint() drops any info previously known about a node.
Date Wed, 19 Jun 2013 19:21:27 GMT
Updated Branches:
  refs/heads/cassandra-1.2 5b525c1fc -> fc5044f59


Gossiper.addSavedEndpoint() drops any info previously known about a node.


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

Branch: refs/heads/cassandra-1.2
Commit: 00126da7b59cd1083e8a345acd7ba99b7d9fd40e
Parents: b1d7405
Author: Jason Brown <jasedbrown@gmail.com>
Authored: Wed Jun 19 05:49:54 2013 -0700
Committer: Jason Brown <jasedbrown@gmail.com>
Committed: Wed Jun 19 05:49:54 2013 -0700

----------------------------------------------------------------------
 src/java/org/apache/cassandra/gms/Gossiper.java | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/00126da7/src/java/org/apache/cassandra/gms/Gossiper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/gms/Gossiper.java b/src/java/org/apache/cassandra/gms/Gossiper.java
index 79a64fb..efa9865 100644
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@ -1074,7 +1074,19 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
             logger.debug("Attempt to add self as saved endpoint");
             return;
         }
-        EndpointState epState = new EndpointState(new HeartBeatState(0));
+
+        //preserve any previously known, in-memory data about the endpoint (such as DC, RACK,
and so on)
+        EndpointState epState = endpointStateMap.get(ep);
+        if (epState != null)
+        {
+            logger.debug("not replacing a previous epState for {}, but reusing it: {}", ep,
epState);
+            epState.setHeartBeatState(new HeartBeatState(0));
+        }
+        else
+        {
+            epState = new EndpointState(new HeartBeatState(0));
+        }
+
         epState.markDead();
         endpointStateMap.put(ep, epState);
         unreachableEndpoints.put(ep, System.currentTimeMillis());


Mime
View raw message