Skip to content

Commit 211bf1d

Browse files
aboudreaultTheRealFalcon
authored andcommitted
Make sure to only query the native_transport_address column with DSE
1 parent 02faa6d commit 211bf1d

File tree

4 files changed

+21
-14
lines changed

4 files changed

+21
-14
lines changed

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ Features
2525
* Add g:TraversalMetrics/Metrics deserializers (PYTHON-1057)
2626
* Make graph metadata handling more robust (PYTHON-1204)
2727

28+
Bug Fixes
29+
---------
30+
* Make sure to only query the native_transport_address column with DSE (PYTHON-1205)
31+
2832
3.21.0
2933
======
3034
January 15, 2020

build.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ schedules:
99
matrix:
1010
exclude:
1111
- python: [3.4, 3.6, 3.7, 3.8]
12-
- cassandra: ['2.1', '3.0', 'test-dse']
12+
- cassandra: ['2.1', '3.0', '4.0', 'test-dse']
1313

1414
commit_long_test:
1515
schedule: per_commit
@@ -21,7 +21,7 @@ schedules:
2121
matrix:
2222
exclude:
2323
- python: [3.4, 3.6, 3.7, 3.8]
24-
- cassandra: ['2.1', '3.0', 'test-dse']
24+
- cassandra: ['2.1', '3.0', '4.0', 'test-dse']
2525

2626
commit_branches:
2727
schedule: per_commit
@@ -34,7 +34,7 @@ schedules:
3434
matrix:
3535
exclude:
3636
- python: [3.4, 3.6, 3.7, 3.8]
37-
- cassandra: ['2.1', '3.0', 'test-dse']
37+
- cassandra: ['2.1', '3.0', '4.0', 'test-dse']
3838

3939
commit_branches_dev:
4040
schedule: per_commit
@@ -47,7 +47,7 @@ schedules:
4747
matrix:
4848
exclude:
4949
- python: [2.7, 3.4, 3.7, 3.6, 3.8]
50-
- cassandra: ['2.0', '2.1', '2.2', '3.0', '3.11', 'test-dse', 'dse-4.8', 'dse-5.0', 'dse-6.0', 'dse-6.7', 'dse-6.8']
50+
- cassandra: ['2.0', '2.1', '2.2', '3.0', '4.0', 'test-dse', 'dse-4.8', 'dse-5.0', 'dse-6.0', 'dse-6.8']
5151

5252
release_test:
5353
schedule: per_commit
@@ -139,7 +139,7 @@ schedules:
139139
matrix:
140140
exclude:
141141
- python: [3.4, 3.6, 3.7, 3.8]
142-
- cassandra: ['2.0', '2.1', '2.2', '3.0', 'test-dse']
142+
- cassandra: ['2.0', '2.1', '2.2', '3.0', '4.0', 'test-dse']
143143

144144
python:
145145
- 2.7
@@ -184,7 +184,7 @@ build:
184184
pip install --upgrade pip
185185
pip install -U setuptools
186186
187-
pip install git+ssh://[email protected]/riptano/ccm-private.git
187+
pip install $HOME/ccm
188188
189189
if [ -n "$CCM_IS_DSE" ]; then
190190
pip install -r test-datastax-requirements.txt

cassandra/cluster.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3418,7 +3418,7 @@ class ControlConnection(object):
34183418
_SELECT_SCHEMA_PEERS_TEMPLATE = "SELECT peer, host_id, {nt_col_name}, schema_version FROM system.peers"
34193419
_SELECT_SCHEMA_LOCAL = "SELECT schema_version FROM system.local WHERE key='local'"
34203420

3421-
_MINIMUM_NATIVE_ADDRESS_VERSION = "4.0"
3421+
_MINIMUM_NATIVE_ADDRESS_DSE_VERSION = Version("6.0.0")
34223422

34233423
_is_shutdown = False
34243424
_timeout = None
@@ -3978,14 +3978,17 @@ def _peers_query_for_version(self, connection, peers_query_template):
39783978
field named nt_col_name.
39793979
"""
39803980
host_release_version = self._cluster.metadata.get_host(connection.endpoint).release_version
3981-
if host_release_version:
3982-
use_native_address_query = host_release_version >= self._MINIMUM_NATIVE_ADDRESS_VERSION
3983-
if use_native_address_query:
3984-
select_peers_query = peers_query_template.format(nt_col_name="native_transport_address")
3985-
else:
3981+
host_dse_version = self._cluster.metadata.get_host(connection.endpoint).dse_version
3982+
uses_native_address_query = (
3983+
host_dse_version and Version(host_dse_version) >= self._MINIMUM_NATIVE_ADDRESS_DSE_VERSION)
3984+
3985+
if uses_native_address_query:
3986+
select_peers_query = peers_query_template.format(nt_col_name="native_transport_address")
3987+
elif host_release_version:
39863988
select_peers_query = peers_query_template.format(nt_col_name="rpc_address")
39873989
else:
39883990
select_peers_query = self._SELECT_PEERS
3991+
39893992
return select_peers_query
39903993

39913994
def _signal_error(self):

tests/integration/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def _get_dse_version_from_cass(cass_version):
178178
cassandra_version = Version(mcv_string)
179179

180180
CASSANDRA_VERSION = Version(mcv_string) if mcv_string else cassandra_version
181-
CCM_VERSION = mcv_string or cv_string
181+
CCM_VERSION = mcv_string if mcv_string else cv_string
182182

183183
CASSANDRA_IP = os.getenv('CLUSTER_IP', '127.0.0.1')
184184
CASSANDRA_DIR = os.getenv('CASSANDRA_DIR', None)
@@ -472,7 +472,7 @@ def use_cluster(cluster_name, nodes, ipformat=None, start=True, workloads=None,
472472
set_default_cass_ip()
473473

474474
if ccm_options is None and DSE_VERSION:
475-
ccm_options = {"version": DSE_VERSION}
475+
ccm_options = {"version": CCM_VERSION}
476476
elif ccm_options is None:
477477
ccm_options = CCM_KWARGS.copy()
478478

0 commit comments

Comments
 (0)