You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Joshua McKenzie (JIRA)" <ji...@apache.org> on 2017/08/22 13:42:00 UTC
[jira] [Updated] (CASSANDRA-13693) A potential problem in the
Ec2MultiRegionSnitch_gossiperStarting method
[ https://issues.apache.org/jira/browse/CASSANDRA-13693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joshua McKenzie updated CASSANDRA-13693:
----------------------------------------
Component/s: Distributed Metadata
> 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
>
> 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
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org