cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eev...@apache.org
Subject git commit: update host ID before token
Date Thu, 31 May 2012 16:10:27 GMT
Updated Branches:
  refs/heads/trunk d71250349 -> dc9e70eda


update host ID before token

Patch by eevans; reviewed by Brandon Williams for CASSANDRA-4300


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

Branch: refs/heads/trunk
Commit: dc9e70eda38ee5dfb6fa2e80bc59b46d49dffa77
Parents: d712503
Author: Eric Evans <eevans@apache.org>
Authored: Thu May 31 13:54:46 2012 +0100
Committer: Eric Evans <eevans@apache.org>
Committed: Thu May 31 17:11:01 2012 +0100

----------------------------------------------------------------------
 .../apache/cassandra/service/StorageService.java   |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/dc9e70ed/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index 4f4c996..af34413 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1083,6 +1083,10 @@ public class StorageService implements IEndpointStateChangeSubscriber,
StorageSe
         if (tokenMetadata.isMember(endpoint))
             logger.info("Node " + endpoint + " state jump to normal");
 
+        // Order Matters, TM.updateHostID() should be called before TM.updateNormalToken(),
(see CASSANDRA-4300).
+        if (Gossiper.instance.getVersion(endpoint) >= MessagingService.VERSION_12)
+            tokenMetadata.updateHostId(UUID.fromString(pieces[1]), endpoint);
+
         // we don't want to update if this node is responsible for the token and it has a
later startup time than endpoint.
         InetAddress currentOwner = tokenMetadata.getEndpoint(token);
         if (currentOwner == null)
@@ -1117,9 +1121,6 @@ public class StorageService implements IEndpointStateChangeSubscriber,
StorageSe
             tokenMetadata.removeFromMoving(endpoint);
 
         calculatePendingRanges();
-
-        if (Gossiper.instance.getVersion(endpoint) >= MessagingService.VERSION_12)
-            tokenMetadata.updateHostId(UUID.fromString(pieces[1]), endpoint);
     }
 
     /**


Mime
View raw message