mirror of https://github.com/apache/cassandra
Do not specify local address on outgoing connection when listen_on_broadcast_address is set
Patch by Milan Majercik; Reviewed by Paulo Motta for CASSANDRA-12673
This commit is contained in:
parent
0b97c5d1f7
commit
dd415263cc
|
|
@ -1,4 +1,5 @@
|
|||
2.2.9
|
||||
* Do not specify local address on outgoing connection when listen_on_broadcast_address is set (CASSANDRA-12673)
|
||||
* Use saved tokens when setting local tokens on StorageService.joinRing (CASSANDRA-12935)
|
||||
* cqlsh: fix DESC TYPES errors (CASSANDRA-12914)
|
||||
* Fix leak on skipped SSTables in sstableupgrade (CASSANDRA-12899)
|
||||
|
|
|
|||
|
|
@ -250,7 +250,11 @@ public class Config
|
|||
|
||||
public MemtableAllocationType memtable_allocation_type = MemtableAllocationType.heap_buffers;
|
||||
|
||||
private static boolean outboundBindAny = false;
|
||||
/**
|
||||
* @deprecated No longer needed for streaming protocol. See CASSANDRA-12673 for details.
|
||||
*/
|
||||
@Deprecated
|
||||
protected static boolean outboundBindAny = false;
|
||||
|
||||
public volatile int tombstone_warn_threshold = 1000;
|
||||
public volatile int tombstone_failure_threshold = 100000;
|
||||
|
|
|
|||
|
|
@ -1752,6 +1752,11 @@ public class DatabaseDescriptor
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean getOutboundBindAny()
|
||||
{
|
||||
return Config.outboundBindAny || conf.listen_on_broadcast_address;
|
||||
}
|
||||
|
||||
public static int getIndexSummaryResizeIntervalInMinutes()
|
||||
{
|
||||
return conf.index_summary_resize_interval_in_minutes;
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ public class OutboundTcpConnectionPool
|
|||
// zero means 'bind on any available port.'
|
||||
if (isEncryptedChannel(endpoint))
|
||||
{
|
||||
if (Config.getOutboundBindAny())
|
||||
if (DatabaseDescriptor.getOutboundBindAny())
|
||||
return SSLFactory.getSocket(DatabaseDescriptor.getServerEncryptionOptions(), endpoint, DatabaseDescriptor.getSSLStoragePort());
|
||||
else
|
||||
return SSLFactory.getSocket(DatabaseDescriptor.getServerEncryptionOptions(), endpoint, DatabaseDescriptor.getSSLStoragePort(), FBUtilities.getLocalAddress(), 0);
|
||||
|
|
@ -137,7 +137,7 @@ public class OutboundTcpConnectionPool
|
|||
else
|
||||
{
|
||||
SocketChannel channel = SocketChannel.open();
|
||||
if (!Config.getOutboundBindAny())
|
||||
if (!DatabaseDescriptor.getOutboundBindAny())
|
||||
channel.bind(new InetSocketAddress(FBUtilities.getLocalAddress(), 0));
|
||||
channel.connect(new InetSocketAddress(endpoint, DatabaseDescriptor.getStoragePort()));
|
||||
return channel.socket();
|
||||
|
|
|
|||
Loading…
Reference in New Issue