Merge branch 'cassandra-3.0' into cassandra-3.11
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a85b0071 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a85b0071 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a85b0071 Branch: refs/heads/cassandra-3.11 Commit: a85b007103ec2ffcfac2ce9e591bc26657089549 Parents: a06b469 5f64ed7 Author: Carl Yeksigian <c...@apache.org> Authored: Mon Dec 5 12:27:57 2016 -0500 Committer: Carl Yeksigian <c...@apache.org> Committed: Mon Dec 5 12:27:57 2016 -0500 ---------------------------------------------------------------------- CHANGES.txt | 1 + src/java/org/apache/cassandra/service/StorageService.java | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/a85b0071/CHANGES.txt ---------------------------------------------------------------------- diff --cc CHANGES.txt index e69a67a,5cacdd0..c04c2fa --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -163,9 -48,6 +163,10 @@@ Merged from 3.0 * Correct log message for statistics of offheap memtable flush (CASSANDRA-12776) * Explicitly set locale for string validation (CASSANDRA-12541,CASSANDRA-12542,CASSANDRA-12543,CASSANDRA-12545) Merged from 2.2: ++ * Use saved tokens when setting local tokens on StorageService.joinRing (CASSANDRA-12935) + * cqlsh: fix DESC TYPES errors (CASSANDRA-12914) + * Fix leak on skipped SSTables in sstableupgrade (CASSANDRA-12899) + * Avoid blocking gossip during pending range calculation (CASSANDRA-12281) * Fix purgeability of tombstones with max timestamp (CASSANDRA-12792) * Fail repair if participant dies during sync or anticompaction (CASSANDRA-12901) * cqlsh COPY: unprotected pk values before converting them if not using prepared statements (CASSANDRA-12863) http://git-wip-us.apache.org/repos/asf/cassandra/blob/a85b0071/src/java/org/apache/cassandra/service/StorageService.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/service/StorageService.java index 07eb1d8,9bf8c54..a53187f --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@@ -986,7 -917,8 +987,7 @@@ public class StorageService extends Not { if (dataAvailable) { - finishJoiningRing(bootstrap); - finishJoiningRing(bootstrapTokens); - ++ finishJoiningRing(bootstrap, bootstrapTokens); // remove the existing info about the replaced node. if (!current.isEmpty()) { @@@ -1041,26 -967,17 +1042,26 @@@ } else if (isSurveyMode) { - isSurveyMode = false; logger.info("Leaving write survey mode and joining ring at operator request"); - finishJoiningRing(resumedBootstrap); - finishJoiningRing(SystemKeyspace.getSavedTokens()); ++ finishJoiningRing(resumedBootstrap, SystemKeyspace.getSavedTokens()); + isSurveyMode = false; } } - private void finishJoiningRing(Collection<Token> tokens) + private void executePreJoinTasks(boolean bootstrap) + { + StreamSupport.stream(ColumnFamilyStore.all().spliterator(), false) + .filter(cfs -> Schema.instance.getUserKeyspaces().contains(cfs.keyspace.getName())) + .forEach(cfs -> cfs.indexManager.executePreJoinTasksBlocking(bootstrap)); + } + - private void finishJoiningRing(boolean didBootstrap) ++ private void finishJoiningRing(boolean didBootstrap, Collection<Token> tokens) { // start participating in the ring. + setMode(Mode.JOINING, "Finish joining ring", true); SystemKeyspace.setBootstrapState(SystemKeyspace.BootstrapState.COMPLETED); + executePreJoinTasks(didBootstrap); - setTokens(bootstrapTokens); + setTokens(tokens); assert tokenMetadata.sortedTokens().size() > 0; doAuthSetup();