From 0132e546b55b67f68fca230c9e0ca1ccef6aa273 Mon Sep 17 00:00:00 2001 From: Dave Brosius Date: Wed, 7 May 2014 01:34:02 -0400 Subject: [PATCH] remove duplicate queries for local tokens patch by dbrosius reviewed by ayeschenko for cassandra-7182 --- CHANGES.txt | 1 + src/java/org/apache/cassandra/service/StorageService.java | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 8c1d234faa..d7b7f00531 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -20,6 +20,7 @@ * fix npe when doing -Dcassandra.fd_initial_value_ms (CASSANDRA-6751) * Preserves CQL metadata when updating table from thrift (CASSANDRA-6831) * fix time conversion to milliseconds in SimpleCondition.await (CASSANDRA-7149) + * remove duplicate query for local tokens (CASSANDRA-7182) 1.2.16 diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java index ed6d031fa8..7cecec99a3 100644 --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@ -209,8 +209,9 @@ public class StorageService extends NotificationBroadcasterSupport implements IE SystemTable.updateTokens(tokens); tokenMetadata.updateNormalTokens(tokens, FBUtilities.getBroadcastAddress()); // order is important here, the gossiper can fire in between adding these two states. It's ok to send TOKENS without STATUS, but *not* vice versa. - Gossiper.instance.addLocalApplicationState(ApplicationState.TOKENS, valueFactory.tokens(getLocalTokens())); - Gossiper.instance.addLocalApplicationState(ApplicationState.STATUS, valueFactory.normal(getLocalTokens())); + Collection localTokens = getLocalTokens(); + Gossiper.instance.addLocalApplicationState(ApplicationState.TOKENS, valueFactory.tokens(localTokens)); + Gossiper.instance.addLocalApplicationState(ApplicationState.STATUS, valueFactory.normal(localTokens)); setMode(Mode.NORMAL, false); }