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/48a48c7f Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/48a48c7f Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/48a48c7f Branch: refs/heads/trunk Commit: 48a48c7fcd06213c77a9490f0d2c8b32baa2b1e4 Parents: 08363af e2ee204 Author: Jay Zhuang <jay.zhu...@yahoo.com> Authored: Sun Dec 30 21:53:05 2018 -0800 Committer: Jay Zhuang <jay.zhu...@yahoo.com> Committed: Sun Dec 30 21:54:56 2018 -0800 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../cassandra/service/CassandraDaemon.java | 47 ++++++++++++++ .../cassandra/service/StorageService.java | 66 +++++++++++++++++--- .../cassandra/service/StorageServiceMBean.java | 7 +++ .../org/apache/cassandra/tools/NodeProbe.java | 5 ++ .../apache/cassandra/tools/nodetool/Join.java | 1 + 6 files changed, 117 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/48a48c7f/CHANGES.txt ---------------------------------------------------------------------- diff --cc CHANGES.txt index 0d97d3c,d29cdc1..3d41d83 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -35,28 -33,10 +35,29 @@@ Merged from 3.0 * Returns null instead of NaN or Infinity in JSON strings (CASSANDRA-14377) -3.0.17 +3.11.3 + * Validate supported column type with SASI analyzer (CASSANDRA-13669) + * Remove BTree.Builder Recycler to reduce memory usage (CASSANDRA-13929) + * Reduce nodetool GC thread count (CASSANDRA-14475) + * Fix New SASI view creation during Index Redistribution (CASSANDRA-14055) + * Remove string formatting lines from BufferPool hot path (CASSANDRA-14416) + * Update metrics to 3.1.5 (CASSANDRA-12924) + * Detect OpenJDK jvm type and architecture (CASSANDRA-12793) + * Don't use guava collections in the non-system keyspace jmx attributes (CASSANDRA-12271) + * Allow existing nodes to use all peers in shadow round (CASSANDRA-13851) + * Fix cqlsh to read connection.ssl cqlshrc option again (CASSANDRA-14299) + * Downgrade log level to trace for CommitLogSegmentManager (CASSANDRA-14370) + * CQL fromJson(null) throws NullPointerException (CASSANDRA-13891) + * Serialize empty buffer as empty string for json output format (CASSANDRA-14245) + * Allow logging implementation to be interchanged for embedded testing (CASSANDRA-13396) + * SASI tokenizer for simple delimiter based entries (CASSANDRA-14247) + * Fix Loss of digits when doing CAST from varint/bigint to decimal (CASSANDRA-14170) + * RateBasedBackPressure unnecessarily invokes a lock on the Guava RateLimiter (CASSANDRA-14163) + * Fix wildcard GROUP BY queries (CASSANDRA-14209) +Merged from 3.0: ++ * Don't enable client transports when bootstrap is pending (CASSANDRA-14525) * Fix corrupted static collection deletions in 3.0 -> 2.{1,2} messages (CASSANDRA-14568) * Fix potential IndexOutOfBoundsException with counters (CASSANDRA-14167) - * Restore resumable hints delivery, backport CASSANDRA-11960 (CASSANDRA-14419) * Always close RT markers returned by ReadCommand#executeLocally() (CASSANDRA-14515) * Reverse order queries with range tombstones can cause data loss (CASSANDRA-14513) * Fix regression of lagging commitlog flush log message (CASSANDRA-14451) http://git-wip-us.apache.org/repos/asf/cassandra/blob/48a48c7f/src/java/org/apache/cassandra/service/CassandraDaemon.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/service/CassandraDaemon.java index d9bd5c3,6869d2c..fbafd35 --- a/src/java/org/apache/cassandra/service/CassandraDaemon.java +++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java @@@ -642,13 -633,31 +666,36 @@@ public class CassandraDaemo } } + public void applyConfig() + { + DatabaseDescriptor.daemonInitialization(); + } + public void startNativeTransport() { + // We only start transports if bootstrap has completed and we're not in survey mode, OR if we are in + // survey mode and streaming has completed but we're not using auth. + // OR if we have not joined the ring yet. + if (StorageService.instance.hasJoined()) + { + if (StorageService.instance.isSurveyMode()) + { + if (StorageService.instance.isBootstrapMode() || DatabaseDescriptor.getAuthenticator().requireAuthentication()) + { + throw new IllegalStateException("Not starting client transports in write_survey mode as it's bootstrapping or " + + "auth is enabled"); + } + } + else + { + if (!SystemKeyspace.bootstrapComplete()) + { + throw new IllegalStateException("Node is not yet bootstrapped completely. Use nodetool to check bootstrap" + + " state and resume. For more, see `nodetool help bootstrap`"); + } + } + } + if (nativeTransportService == null) throw new IllegalStateException("setup() must be called first for CassandraDaemon"); else http://git-wip-us.apache.org/repos/asf/cassandra/blob/48a48c7f/src/java/org/apache/cassandra/service/StorageService.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/service/StorageService.java index edd8571,55bc9ae..b504995 --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@@ -361,6 -364,29 +371,23 @@@ public class StorageService extends Not { throw new IllegalStateException("No configured daemon"); } + + // We only start transports if bootstrap has completed and we're not in survey mode, OR if we are in + // survey mode and streaming has completed but we're not using auth. + // OR if we have not joined the ring yet. - if (StorageService.instance.hasJoined()) ++ if (StorageService.instance.hasJoined() && ++ ((!StorageService.instance.isSurveyMode() && !SystemKeyspace.bootstrapComplete()) || ++ (StorageService.instance.isSurveyMode() && StorageService.instance.isBootstrapMode()))) + { - if (StorageService.instance.isSurveyMode()) - { - if (StorageService.instance.isBootstrapMode() || DatabaseDescriptor.getAuthenticator().requireAuthentication()) - { - throw new IllegalStateException("Not starting RPC server in write_survey mode as it's bootstrapping or " + - "auth is enabled"); - } - } - else - { - if (!SystemKeyspace.bootstrapComplete()) - { - throw new IllegalStateException("Node is not yet bootstrapped completely. Use nodetool to check bootstrap state and resume. For more, see `nodetool help bootstrap`"); - } - } ++ throw new IllegalStateException("Node is not yet bootstrapped completely. Use nodetool to check bootstrap state and resume. For more, see `nodetool help bootstrap`"); ++ } ++ else if (StorageService.instance.hasJoined() && StorageService.instance.isSurveyMode() && ++ DatabaseDescriptor.getAuthenticator().requireAuthentication()) ++ { ++ // Auth isn't initialised until we join the ring, so if we're in survey mode auth will always fail. ++ throw new IllegalStateException("Not starting RPC server as write_survey mode and authentication is enabled"); + } + daemon.thriftServer.start(); } @@@ -1053,9 -1018,24 +1083,24 @@@ } else if (isSurveyMode) { - logger.info("Leaving write survey mode and joining ring at operator request"); - finishJoiningRing(resumedBootstrap, SystemKeyspace.getSavedTokens()); - isSurveyMode = false; + // if isSurveyMode is on then verify isBootstrapMode + // node can join the ring even if isBootstrapMode is true which should not happen + if (!isBootstrapMode()) + { + isSurveyMode = false; + logger.info("Leaving write survey mode and joining ring at operator request"); - finishJoiningRing(SystemKeyspace.getSavedTokens()); ++ finishJoiningRing(resumedBootstrap, SystemKeyspace.getSavedTokens()); + daemon.start(); + } + else + { + logger.warn("Can't join the ring because in write_survey mode and bootstrap hasn't completed"); + } + } + else if (isBootstrapMode()) + { + // bootstrap is not complete hence node cannot join the ring + logger.warn("Can't join the ring because bootstrap hasn't completed."); } } @@@ -1574,19 -1338,18 +1619,20 @@@ public void onSuccess(StreamState streamState) { bootstrapFinished(); + // start participating in the ring. + // pretend we are in survey mode so we can use joinRing() here - isSurveyMode = true; - try + if (isSurveyMode) { - progressSupport.progress("bootstrap", ProgressEvent.createNotification("Joining ring...")); - joinRing(true); + logger.info("Startup complete, but write survey mode is active, not becoming an active ring member. Use JMX (StorageService->joinRing()) to finalize ring joining."); } - catch (IOException ignore) + else { - // joinRing with survey mode does not throw IOException + isSurveyMode = false; + progressSupport.progress("bootstrap", ProgressEvent.createNotification("Joining ring...")); - finishJoiningRing(bootstrapTokens); ++ finishJoiningRing(true, bootstrapTokens); } progressSupport.progress("bootstrap", new ProgressEvent(ProgressEventType.COMPLETE, 1, 1, "Resume bootstrap complete")); + daemon.start(); logger.info("Resume complete"); } http://git-wip-us.apache.org/repos/asf/cassandra/blob/48a48c7f/src/java/org/apache/cassandra/service/StorageServiceMBean.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/service/StorageServiceMBean.java index 5613c35,835da17..e8aad77 --- a/src/java/org/apache/cassandra/service/StorageServiceMBean.java +++ b/src/java/org/apache/cassandra/service/StorageServiceMBean.java @@@ -532,30 -495,13 +532,37 @@@ public interface StorageServiceMBean ex public boolean isDrained(); public boolean isDraining(); + /** Check if currently bootstrapping. + * Note this becomes false before {@link org.apache.cassandra.db.SystemKeyspace#bootstrapComplete()} is called, + * as setting bootstrap to complete is called only when the node joins the ring. + * @return True prior to bootstrap streaming completing. False prior to start of bootstrap and post streaming. + */ + public boolean isBootstrapMode(); + + public void setRpcTimeout(long value); + public long getRpcTimeout(); + + public void setReadRpcTimeout(long value); + public long getReadRpcTimeout(); + + public void setRangeRpcTimeout(long value); + public long getRangeRpcTimeout(); + + public void setWriteRpcTimeout(long value); + public long getWriteRpcTimeout(); + + public void setCounterWriteRpcTimeout(long value); + public long getCounterWriteRpcTimeout(); + + public void setCasContentionTimeout(long value); + public long getCasContentionTimeout(); + + public void setTruncateRpcTimeout(long value); + public long getTruncateRpcTimeout(); + + public void setStreamingSocketTimeout(int value); + public int getStreamingSocketTimeout(); + public void setStreamThroughputMbPerSec(int value); public int getStreamThroughputMbPerSec(); http://git-wip-us.apache.org/repos/asf/cassandra/blob/48a48c7f/src/java/org/apache/cassandra/tools/NodeProbe.java ---------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org