cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hao Zhong (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CASSANDRA-13693) A potential problem in the Ec2MultiRegionSnitch_gossiperStarting method
Date Fri, 14 Jul 2017 07:44:00 GMT
Hao Zhong created CASSANDRA-13693:
-------------------------------------

             Summary: 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
            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


Mime
View raw message