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

Runtian Liu commented on CASSANDRA-18935:
-----------------------------------------

[~brandon.williams] , I think the problem of "STATUS" is that when a node 
started, it will broadcast the NORMAL status to peers. For this just started 
node, the gossip may have some delay so it may only have the partial view of 
the cluster. This means the node will consider part of the cluster is down. 
What we really want in counter mutation is to make sure the leader recent 
started node(or a new node) is fully connected to the cluster so it has full 
view of the cluster.

The reason we chose RPC_READY might be that this flag was set to true only when 
everything is done.  But this flag is indicating if binary port is enabled, I 
don't think we should use this flag.

I see 4.0 has added a checker before enabling binary port: 
[https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/service/CassandraDaemon.java#L644]

 

I think it's better to create a new flag like "FULLY_CONNECTED" so that we know 
the node has a full view of the cluster. Then we can use this flag in counter 
mutation and keep "RPC_READY" like what we have today: 1. set to true when 
binary port enabled. 2. set to false when binary port disabled.

 

> Fix nodetool enable/disablebinary to correctly set rpc
> ------------------------------------------------------
>
>                 Key: CASSANDRA-18935
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18935
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Legacy/Core, Legacy/CQL
>            Reporter: Cameron Zemek
>            Assignee: Stefan Miklosovic
>            Priority: Normal
>             Fix For: 3.0.x, 3.11.x, 4.0.x, 4.1.x, 5.0-rc, 5.x
>
>         Attachments: 18935-3.11.patch, image-2023-11-16-10-56-16-693.png
>
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
>  
> {code:java}
>         if ((nativeFlag != null && Boolean.parseBoolean(nativeFlag)) || 
> (nativeFlag == null && DatabaseDescriptor.startNativeTransport()))
>         {
>             startNativeTransport();
>             StorageService.instance.setRpcReady(true);
>         } {code}
> The startup code here only sets RpcReady if native transport is enabled. If 
> you call 
> {code:java}
> nodetool enablebinary{code}
> then this flag doesn't get set.
> But with the change from CASSANDRA-13043 it requires RpcReady set to true in 
> order to get a leader for the counter update.
> Not sure what the correct fix is here, seems to only really use this flag for 
> counters. So thinking perhaps the fix is to just move this outside the if 
> condition.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to