cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [04/15] git commit: Clone token map outside of hot gossip loops patch by rbranson; reviewed by jbellis for CASSANDRA-7758
Date Tue, 12 Aug 2014 21:31:35 GMT
Clone token map outside of hot gossip loops
patch by rbranson; reviewed by jbellis for CASSANDRA-7758


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

Branch: refs/heads/trunk
Commit: 2738e86783490a6bb83273281e8c4c4dcb873a3d
Parents: b55f38b
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Tue Aug 12 16:23:43 2014 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Tue Aug 12 16:23:43 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                                       | 1 +
 .../apache/cassandra/service/PendingRangeCalculatorService.java   | 3 ++-
 src/java/org/apache/cassandra/service/StorageService.java         | 3 ++-
 3 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2738e867/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 2c95a52..5dd3ad2 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 1.2.19
+ * Clone token map outside of hot gossip loops (CASSANDRA-7758)
  * Add stop method to EmbeddedCassandraService (CASSANDRA-7595)
  * Support connecting to ipv6 jmx with nodetool (CASSANDRA-7669)
  * Set gc_grace_seconds to seven days for system schema tables (CASSANDRA-7668)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2738e867/src/java/org/apache/cassandra/service/PendingRangeCalculatorService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/PendingRangeCalculatorService.java b/src/java/org/apache/cassandra/service/PendingRangeCalculatorService.java
index 1c0d977..d8b7586 100644
--- a/src/java/org/apache/cassandra/service/PendingRangeCalculatorService.java
+++ b/src/java/org/apache/cassandra/service/PendingRangeCalculatorService.java
@@ -144,9 +144,10 @@ public class PendingRangeCalculatorService extends PendingRangeCalculatorService
 
         // for each of those ranges, find what new nodes will be responsible for the range
when
         // all leaving nodes are gone.
+        TokenMetadata metadata = tm.cloneOnlyTokenMap(); // don't do this in the loop! #7758
         for (Range<Token> range : affectedRanges)
         {
-            Set<InetAddress> currentEndpoints = ImmutableSet.copyOf(strategy.calculateNaturalEndpoints(range.right,
tm.cloneOnlyTokenMap()));
+            Set<InetAddress> currentEndpoints = ImmutableSet.copyOf(strategy.calculateNaturalEndpoints(range.right,
metadata));
             Set<InetAddress> newEndpoints = ImmutableSet.copyOf(strategy.calculateNaturalEndpoints(range.right,
allLeftMetadata));
             pendingRanges.putAll(range, Sets.difference(newEndpoints, currentEndpoints));
         }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2738e867/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 047e8d6..563b259 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1940,8 +1940,9 @@ public class StorageService extends NotificationBroadcasterSupport implements
IE
         Map<Range<Token>, List<InetAddress>> currentReplicaEndpoints =
new HashMap<Range<Token>, List<InetAddress>>();
 
         // Find (for each range) all nodes that store replicas for these ranges as well
+        TokenMetadata metadata = tokenMetadata.cloneOnlyTokenMap(); // don't do this in the
loop! #7758
         for (Range<Token> range : ranges)
-            currentReplicaEndpoints.put(range, Table.open(table).getReplicationStrategy().calculateNaturalEndpoints(range.right,
tokenMetadata.cloneOnlyTokenMap()));
+            currentReplicaEndpoints.put(range, Table.open(table).getReplicationStrategy().calculateNaturalEndpoints(range.right,
metadata));
 
         TokenMetadata temp = tokenMetadata.cloneAfterAllLeft();
 


Mime
View raw message