Merge branch 'cassandra-3.11' into trunk

This commit is contained in:
Blake Eggleston 2019-10-07 11:35:28 -07:00
commit e8ff2f2b8e
2 changed files with 10 additions and 0 deletions

View File

@ -5,6 +5,7 @@
* Add `allocate_tokens_for_local_replication_factor` option for token allocation (CASSANDRA-15260)
* Add Alibaba Cloud Platform snitch (CASSANDRA-15092)
Merged from 3.0:
* Gossip tokens on startup if available (CASSANDRA-15335)
* Fix resource leak in CompressedSequentialWriter (CASSANDRA-15340)
* Fix bad merge that reverted CASSANDRA-14993 (CASSANDRA-15289)

View File

@ -794,6 +794,15 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
else
{
checkForEndpointCollision(localHostId, SystemKeyspace.loadHostIds().keySet());
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