[ 
https://issues.apache.org/jira/browse/CASSANDRA-11381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15704157#comment-15704157
 ] 

Joel Knighton commented on CASSANDRA-11381:
-------------------------------------------

Thanks - the patches look good and I put them through CI.

||branch||testall||dtest||
|[CASSANDRA-11381-2.2|https://github.com/jkni/cassandra/tree/CASSANDRA-11381-2.2]|[testall|http://cassci.datastax.com/view/Dev/view/jkni/job/jkni-CASSANDRA-11381-2.2-testall]|[dtest|http://cassci.datastax.com/view/Dev/view/jkni/job/jkni-CASSANDRA-11381-2.2-dtest]|
|[CASSANDRA-11381-3.0|https://github.com/jkni/cassandra/tree/CASSANDRA-11381-3.0]|[testall|http://cassci.datastax.com/view/Dev/view/jkni/job/jkni-CASSANDRA-11381-3.0-testall]|[dtest|http://cassci.datastax.com/view/Dev/view/jkni/job/jkni-CASSANDRA-11381-3.0-dtest]|
|[CASSANDRA-11381-3.X|https://github.com/jkni/cassandra/tree/CASSANDRA-11381-3.X]|[testall|http://cassci.datastax.com/view/Dev/view/jkni/job/jkni-CASSANDRA-11381-3.X-testall]|[dtest|http://cassci.datastax.com/view/Dev/view/jkni/job/jkni-CASSANDRA-11381-3.X-dtest]|
|[CASSANDRA-11381-trunk|https://github.com/jkni/cassandra/tree/CASSANDRA-11381-trunk]|[testall|http://cassci.datastax.com/view/Dev/view/jkni/job/jkni-CASSANDRA-11381-trunk-testall]|[dtest|http://cassci.datastax.com/view/Dev/view/jkni/job/jkni-CASSANDRA-11381-trunk-dtest]|

CI looks good for the most part, and I checked that your added dtest passes on 
all branches. CI revealed one small problem - when a fresh node is started with 
join_ring=False that has no tokens for other nodes discovered through gossip 
and no saved tokens, it hits an AssertionError in {{CassandraRoleManager}} 
setup that is not handled and gets logged as an error by a top level error 
handler, as seen 
[here|http://cassci.datastax.com/view/Dev/view/jkni/job/jkni-CASSANDRA-11381-2.2-dtest/1/testReport/junit/topology_test/TestTopology/do_not_join_ring_test/].
 In this specific test case, this behavior is hit because a single node cluster 
is started with join_ring=False. Since this prevents setup from being retried 
within the {{CassandraRoleManager}}, it seems to me that it is probably worth 
checking for an absence of tokens in {{CassandraRoleManager.setupDefaultRole}} 
and throwing a catchable exception/printing a warning so that setup can be 
retried. What do you think? There may be another alternative I haven't 
considered.

> Node running with join_ring=false and authentication can not serve requests
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-11381
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11381
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: mck
>            Assignee: mck
>             Fix For: 2.1.x, 2.2.x, 3.0.x, 3.x
>
>         Attachments: 11381-2.1.txt, 11381-2.2.txt, 11381-3.0.txt, 
> 11381-3.X.txt, 11381-trunk.txt, dtest-11381-trunk.txt
>
>
> Starting up a node with {{-Dcassandra.join_ring=false}} in a cluster that has 
> authentication configured, eg PasswordAuthenticator, won't be able to serve 
> requests. This is because {{Auth.setup()}} never gets called during the 
> startup.
> Without {{Auth.setup()}} having been called in {{StorageService}} clients 
> connecting to the node fail with the node throwing
> {noformat}
> java.lang.NullPointerException
>         at 
> org.apache.cassandra.auth.PasswordAuthenticator.authenticate(PasswordAuthenticator.java:119)
>         at 
> org.apache.cassandra.thrift.CassandraServer.login(CassandraServer.java:1471)
>         at 
> org.apache.cassandra.thrift.Cassandra$Processor$login.getResult(Cassandra.java:3505)
>         at 
> org.apache.cassandra.thrift.Cassandra$Processor$login.getResult(Cassandra.java:3489)
>         at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
>         at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
>         at com.thinkaurelius.thrift.Message.invoke(Message.java:314)
>         at 
> com.thinkaurelius.thrift.Message$Invocation.execute(Message.java:90)
>         at 
> com.thinkaurelius.thrift.TDisruptorServer$InvocationHandler.onEvent(TDisruptorServer.java:695)
>         at 
> com.thinkaurelius.thrift.TDisruptorServer$InvocationHandler.onEvent(TDisruptorServer.java:689)
>         at com.lmax.disruptor.WorkProcessor.run(WorkProcessor.java:112)
>         at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>         at java.lang.Thread.run(Thread.java:745)
> {noformat}
> The exception thrown from the 
> [code|https://github.com/apache/cassandra/blob/cassandra-2.0.16/src/java/org/apache/cassandra/auth/PasswordAuthenticator.java#L119]
> {code}
> ResultMessage.Rows rows = 
> authenticateStatement.execute(QueryState.forInternalCalls(), new 
> QueryOptions(consistencyForUser(username),
>                                                                               
>        Lists.newArrayList(ByteBufferUtil.bytes(username))));
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to