cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject [2/3] git commit: Correctly expire gossip states for edge cases. Patch by yangwei, reviewed by brandonwilliams for CASSANDRA-5216
Date Mon, 04 Feb 2013 19:07:31 GMT
Correctly expire gossip states for edge cases.
Patch by yangwei, reviewed by brandonwilliams for CASSANDRA-5216


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

Branch: refs/heads/trunk
Commit: 75d0f7a3fa864031b6214cc8fcd619966b96e0a6
Parents: 82de0ec
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Mon Feb 4 13:04:58 2013 -0600
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Mon Feb 4 13:07:13 2013 -0600

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 src/java/org/apache/cassandra/gms/Gossiper.java    |    6 +++++-
 .../apache/cassandra/service/StorageService.java   |    3 +++
 3 files changed, 9 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/75d0f7a3/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 6b3a705..e0e8079 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -7,6 +7,7 @@
  * configure populate_io_cache_on_flush per-CF (CASSANDRA-4694)
  * allow configuration of internode socket buffer (CASSANDRA-3378)
  * Make sstable directory picking blacklist-aware again (CASSANDRA-5193)
+ * Correctly expire gossip states for edge cases (CASSANDRA-5216)
 
 1.2.1
  * stream undelivered hints on decommission (CASSANDRA-5128)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/75d0f7a3/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 9ee2f61..c9d0d51 100644
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@ -234,6 +234,8 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
         {
             markDead(endpoint, epState);
         }
+        else
+            epState.markDead();
     }
 
     /**
@@ -389,8 +391,10 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
         EndpointState epState = endpointStateMap.get(endpoint);
         epState.updateTimestamp(); // make sure we don't evict it too soon
         epState.getHeartBeatState().forceNewerGenerationUnsafe();
-        epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.removedNonlocal(hostId,
computeExpireTime()));
+        long expireTime = computeExpireTime();
+        epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.removedNonlocal(hostId,
expireTime));
         logger.info("Completing removal of " + endpoint);
+        addExpireTimeForEndpoint(endpoint, expireTime);
         endpointStateMap.put(endpoint, epState);
         // ensure at least one gossip round occurs before returning
         try

http://git-wip-us.apache.org/repos/asf/cassandra/blob/75d0f7a3/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 979b68e..34b2f12 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1554,7 +1554,10 @@ public class StorageService extends NotificationBroadcasterSupport
implements IE
             }
         }
         else // now that the gossiper has told us about this nonexistent member, notify the
gossiper to remove it
+        {
+            addExpireTimeIfFound(endpoint, extractExpireTime(pieces, MessagingService.instance().getVersion(endpoint)));
             removeEndpoint(endpoint);
+        }
     }
 
     private void excise(Collection<Token> tokens, InetAddress endpoint)


Mime
View raw message