This is an automated email from the ASF dual-hosted git repository. bdeggleston pushed a commit to branch cassandra-3.0 in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/cassandra-3.0 by this push: new 39a431d Gossip tokens on startup if available 39a431d is described below commit 39a431d9d821cf6bcb54da7198b6a64e09b0f120 Author: Blake Eggleston <bdeggles...@gmail.com> AuthorDate: Tue Sep 24 14:27:18 2019 -0700 Gossip tokens on startup if available Patch by Blake Eggleston; Reviewed by Marcus Eriksson and Sam Tunnicliffe for CASSANDRA-15335 --- CHANGES.txt | 1 + src/java/org/apache/cassandra/service/StorageService.java | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 6bf3ee1..ca6ea2e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 3.0.19 + * Gossip tokens on startup if available (CASSANDRA-15335) * Fix resource leak in CompressedSequentialWriter (CASSANDRA-15340) * Fix merge which reverted CASSANDRA-14993 (CASSANDRA-15289) * Fix LegacyLayout RangeTombstoneList IndexOutOfBoundsException when upgrading and RangeTombstone bounds are asymmetric (CASSANDRA-15172) diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java index d349b4b..2af7fb7 100644 --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@ -34,6 +34,7 @@ import javax.management.openmbean.TabularData; import javax.management.openmbean.TabularDataSupport; import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; import com.google.common.base.Predicate; import com.google.common.collect.*; import com.google.common.util.concurrent.*; @@ -56,6 +57,7 @@ import org.apache.cassandra.concurrent.ScheduledExecutors; import org.apache.cassandra.concurrent.Stage; import org.apache.cassandra.concurrent.StageManager; import org.apache.cassandra.config.CFMetaData; +import org.apache.cassandra.config.Config; import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.config.Schema; import org.apache.cassandra.config.ViewDefinition; @@ -767,6 +769,15 @@ public class StorageService extends NotificationBroadcasterSupport implements IE { checkForEndpointCollision(); } + else if (SystemKeyspace.bootstrapComplete()) + { + Preconditions.checkState(!Config.isClientMode()); + // tokens are only ever saved to system.local after bootstrap has completed and we're joining the ring, + // or when token update operations (move, decom) are completed + Collection<Token> savedTokens = SystemKeyspace.getSavedTokens(); + if (!savedTokens.isEmpty()) + appStates.put(ApplicationState.TOKENS, valueFactory.tokens(savedTokens)); + } // have to start the gossip service before we can see any info on other nodes. this is necessary // for bootstrap to get the load info it needs. --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org