[
https://issues.apache.org/jira/browse/CASSANDRA-11537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17655159#comment-17655159
]
Paulo Motta commented on CASSANDRA-11537:
-----------------------------------------
I tested the patch locally and it makes nodetool commands fail gracefully when
the node is not initialized:
BEFORE:
{noformat}
$ nodetool ring
error: null
-- StackTrace --
java.util.NoSuchElementException
at
com.google.common.collect.LinkedHashMultimap$1.next(LinkedHashMultimap.java:532)
at
com.google.common.collect.LinkedHashMultimap$1.next(LinkedHashMultimap.java:520)
at
com.google.common.collect.TransformedIterator.next(TransformedIterator.java:47)
at java.base/java.util.Collections.max(Unknown Source)
at org.apache.cassandra.tools.nodetool.Ring.execute(Ring.java:78)
at
org.apache.cassandra.tools.NodeTool$NodeToolCmd.runInternal(NodeTool.java:372)
at
org.apache.cassandra.tools.NodeTool$NodeToolCmd.run(NodeTool.java:357)
at org.apache.cassandra.tools.NodeTool.execute(NodeTool.java:260)
at org.apache.cassandra.tools.NodeTool.main(NodeTool.java:83)
{noformat}
AFTER
{noformat}
nodetool: Node is not initialized yet.
See 'nodetool help' or 'nodetool help <command>'.
{noformat}
I'd just slightly update the message to something like: {{Server is not
initialized yet, cannot run nodetool.}}
I submitted a CI run but failures look unrelated:
* https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/2153/
One concern mentioned earlier was if commands like {{nodetool join}} where the
server does not join the ring will be affected by this, but it doesn't seem to
be the case as we have a test for that that passed:
*
[test_bootstrap_on_write_survey|https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/2153/testReport/dtest-novnode.bootstrap_test/TestBootstrap/test_bootstrap_on_write_survey/]
> Give clear error when certain nodetool commands are issued before server is
> ready
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-11537
> URL: https://issues.apache.org/jira/browse/CASSANDRA-11537
> Project: Cassandra
> Issue Type: Improvement
> Components: Legacy/Observability, Local/Startup and Shutdown
> Reporter: Edward Capriolo
> Assignee: William Nguyen
> Priority: Low
> Labels: lhf
> Time Spent: 20m
> Remaining Estimate: 0h
>
> As an ops person upgrading and servicing Cassandra servers, I require a more
> clear message when I issue a nodetool command that the server is not ready
> for it so that I am not confused.
> Technical description:
> If you deploy a new binary, restart, and issue nodetool
> scrub/compact/updatess etc you get unfriendly assertion. An exception would
> be easier to understand. Also if a user has turned assertions off it is
> unclear what might happen.
> {noformat}
> EC1: Throw exception to make it clear server is still in start up process.
> :~# nodetool upgradesstables
> error: null
> -- StackTrace --
> java.lang.AssertionError
> at org.apache.cassandra.db.Keyspace.open(Keyspace.java:97)
> at
> org.apache.cassandra.service.StorageService.getValidKeyspace(StorageService.java:2573)
> at
> org.apache.cassandra.service.StorageService.getValidColumnFamilies(StorageService.java:2661)
> at
> org.apache.cassandra.service.StorageService.upgradeSSTables(StorageService.java:2421)
> {noformat}
> EC1:
> Patch against 2.1 (branch)
> https://github.com/apache/cassandra/compare/trunk...edwardcapriolo:exception-on-startup?expand=1
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]