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

Brandon Williams edited comment on CASSANDRA-1934 at 1/20/11 3:36 PM:
----------------------------------------------------------------------

currentNode (which failed decom and then restarted) does have the correct view 
of itself (normal) but
{code}
        else if (endpoint.equals(currentNode))
        {
            // nothing to do
        }
{code}

Prevents the other nodes from updating the state from 'Leaving' back to 
'normal'.

We almost update the state here:
{code}
        else if (Gossiper.instance.compareEndpointStartup(endpoint, 
currentNode) > 0)
        {
            logger_.info(String.format("Nodes %s and %s have the same token %s. 
 %s is the new owner",
                                       endpoint, currentNode, token, endpoint));
            tokenMetadata_.updateNormalToken(token, endpoint);
            if (!isClientMode)
                SystemTable.updateToken(endpoint, token);
        }
{code}
But don't because the generations will always be equal (in other words, this 
code only handles a *different* node updating the state, not the same node 
returning)


      was (Author: brandon.williams):
    currentNode (which failed decom and then restarted) does have the correct 
view of itself (normal) but
{code}
        else if (endpoint.equals(currentNode))
        {
            // nothing to do
        }
{code}

Prevents the other nodes from updating the state from 'Leaving' back to 
'normal'.

We almost update the state here:
{code}
        else if (Gossiper.instance.compareEndpointStartup(endpoint, 
currentNode) > 0)
        {
            logger_.info(String.format("Nodes %s and %s have the same token %s. 
 %s is the new owner",
                                       endpoint, currentNode, token, endpoint));
            tokenMetadata_.updateNormalToken(token, endpoint);
            if (!isClientMode)
                SystemTable.updateToken(endpoint, token);
        }
{code}
But don't because the generations will always be equal (in other words, this 
code only handles a *different* node updated the state, not the same node 
returning)

  
> Update token metadata for NORMAL state
> --------------------------------------
>
>                 Key: CASSANDRA-1934
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1934
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.7.0 rc 3
>            Reporter: Nick Bailey
>            Assignee: Brandon Williams
>            Priority: Minor
>             Fix For: 0.7.1
>
>         Attachments: 1934.txt
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> The handleStateNormal() method in StorageService.java doesn't update the 
> tokenmetadata. This means if you try to decommission a node but for some 
> reason it fails, and then you bring the node back up, all other nodes will 
> see it in a 'Leaving' state. When the state jumps back to normal they should 
> update the token metadata to reflect that.
> This also means you won't be able to call 'removetoken' on that node, unless 
> you restart another node in the cluster in order to put it back in a 'normal' 
> state.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to