cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject cassandra git commit: Do not specify local address on outgoing connection when listen_on_broadcast_address is set
Date Fri, 09 Dec 2016 18:27:10 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.2 0b97c5d1f -> dd415263c


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


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/dd415263
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/dd415263
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/dd415263

Branch: refs/heads/cassandra-2.2
Commit: dd415263cc698d8b7b7165cb77add233302fcdfe
Parents: 0b97c5d
Author: mmajercik <mmajercik@specter.firstmobileaffiliate.com>
Authored: Wed Dec 7 10:52:02 2016 -0200
Committer: Paulo Motta <paulo@apache.org>
Committed: Thu Dec 8 16:45:33 2016 -0200

----------------------------------------------------------------------
 CHANGES.txt                                                    | 1 +
 src/java/org/apache/cassandra/config/Config.java               | 6 +++++-
 src/java/org/apache/cassandra/config/DatabaseDescriptor.java   | 5 +++++
 .../org/apache/cassandra/net/OutboundTcpConnectionPool.java    | 4 ++--
 4 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/dd415263/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 302becf..6b2a9c0 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -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)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/dd415263/src/java/org/apache/cassandra/config/Config.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java
index 60daee6..9f5a22f 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -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;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/dd415263/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 75f80b9..a3fb79b 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -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;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/dd415263/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java b/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
index 2af0016..2b92036 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
@@ -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();


Mime
View raw message