[ 
https://issues.apache.org/jira/browse/CASSANDRA-13693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Vinay Chella reassigned CASSANDRA-13693:
----------------------------------------

    Assignee: Vinay Chella

> A potential problem in the Ec2MultiRegionSnitch_gossiperStarting method
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-13693
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13693
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Distributed Metadata
>            Reporter: Hao Zhong
>            Assignee: Vinay Chella
>            Priority: Major
>
> The code of Ec2MultiRegionSnitch_gossiperStarting is as follow:
> {code}
>     public void gossiperStarting()
>     {
>         super.gossiperStarting();
>         
> Gossiper.instance.addLocalApplicationState(ApplicationState.INTERNAL_IP, 
> StorageService.instance.valueFactory.internalIP(localPrivateAddress));
>         Gossiper.instance.register(new ReconnectableSnitchHelper(this, 
> ec2region, true));
>     }
> {code}
> I notice that CASSANDRA-5897 fixed a bug, whose buggy code is identical. The 
> fixed code is 
> {code}
> public void gossiperStarting()
>     {
>         super.gossiperStarting();
>         
> Gossiper.instance.addLocalApplicationState(ApplicationState.INTERNAL_IP,
>                 
> StorageService.instance.valueFactory.internalIP(FBUtilities.getLocalAddress().getHostAddress()));
>         reloadGossiperState();
>         gossipStarted = true;
>     }
>     private void reloadGossiperState()
>     {
>         if (Gossiper.instance != null)
>         {
>             ReconnectableSnitchHelper pendingHelper = new 
> ReconnectableSnitchHelper(this, myDC, preferLocal);
>             Gossiper.instance.register(pendingHelper);
>             
>             pendingHelper = snitchHelperReference.getAndSet(pendingHelper);
>             if (pendingHelper != null)
>                 Gossiper.instance.unregister(pendingHelper);
>         }
>         // else this will eventually rerun at gossiperStarting()
>     }
> {code}
> If Ec2MultiRegionSnitch is supposed to auto-reload, the above fix shall be 
> applied to its code.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to