Jan Karlsson commented on CASSANDRA-13639:

The problem stems from the fact that the SSTableLoader has his own way of 
reading the yaml file but still uses the a default created DatabaseDescriptor 
to connect by using {{FBUtilities.getLocalAddress()}}. Perhaps another solution 
maybe to add this as a parameter to SSTableLoader.

In BulkLoadConnectionFactory, after a rather strange if clause that is always 
false, {{SSLFactory.getSocket(encryptionOptions, peer, secureStoragePort, 
FBUtilities.getLocalAddress(), 0);}} fetches the IP address from the 
DatabaseDescriptor which will return null because the listenAddress is not set 
by default on the DatabaseDescriptor object. My patch applies the listen 
address from the yaml file to the DatabaseDescriptor which in turn fixes the 

> SSTableLoader always uses hostname to stream files from
> -------------------------------------------------------
>                 Key: CASSANDRA-13639
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13639
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>            Reporter: Jan Karlsson
>            Assignee: Jan Karlsson
>             Fix For: 4.x
>         Attachments: 13639-trunk
> I stumbled upon an issue where SSTableLoader was ignoring our routing by 
> using the wrong interface to send the SSTables to the other nodes. Looking at 
> the code, it seems that we are using FBUtilities.getLocalAddress() to fetch 
> out the hostname, even if the yaml file specifies a different host. I am not 
> sure why we call this function instead of using the routing by leaving it 
> blank, perhaps someone could enlighten me.
> This behaviour comes from the fact that we use a default created 
> DatabaseDescriptor which does not set the values for listenAddress and 
> listenInterface. This causes the aforementioned function to retrieve the 
> hostname at all times, even if it is not the interface used in the yaml file.
> I propose we break out the function that handles listenAddress and 
> listenInterface and call it so that listenAddress or listenInterface is 
> getting populated in the DatabaseDescriptor.

This message was sent by Atlassian JIRA

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

Reply via email to