Skip to content

Commit 7d7c0cf

Browse files
committed
Merge branch 'master' into private_master
2 parents 2716214 + 05fb2c8 commit 7d7c0cf

File tree

4 files changed

+27
-25
lines changed

4 files changed

+27
-25
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: 8 additions & 7 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
@@ -46,8 +46,8 @@ schedules:
4646
EXCLUDE_LONG=1
4747
matrix:
4848
exclude:
49-
- python: [2.7, 3.4, 3.7, 3.8]
50-
- cassandra: ['2.0', '2.1', '2.2', '3.0', 'test-dse', dse-4.8', 'dse-5.0']
49+
- python: [2.7, 3.4, 3.7, 3.6, 3.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
@@ -157,6 +157,7 @@ cassandra:
157157
- '2.2'
158158
- '3.0'
159159
- '3.11'
160+
- '4.0'
160161
- 'dse-4.8'
161162
- 'dse-5.0'
162163
- 'dse-5.1'
@@ -183,7 +184,7 @@ build:
183184
pip install --upgrade pip
184185
pip install -U setuptools
185186
186-
pip install git+ssh://[email protected]/riptano/ccm-private.git
187+
pip install $HOME/ccm
187188
188189
if [ -n "$CCM_IS_DSE" ]; then
189190
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: 6 additions & 12 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 = cassandra_version if mcv_string else CASSANDRA_VERSION
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,19 +472,13 @@ 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

479-
if 'version' in ccm_options and not isinstance(ccm_options['version'], Version):
480-
ccm_options['version'] = Version(ccm_options['version'])
481-
482479
cassandra_version = ccm_options.get('version', CCM_VERSION)
483480
dse_version = ccm_options.get('version', DSE_VERSION)
484481

485-
if 'version' in ccm_options:
486-
ccm_options['version'] = ccm_options['version'].base_version
487-
488482
global CCM_CLUSTER
489483
if USE_CASS_EXTERNAL:
490484
if CCM_CLUSTER:
@@ -533,7 +527,7 @@ def use_cluster(cluster_name, nodes, ipformat=None, start=True, workloads=None,
533527
CCM_CLUSTER = DseCluster(path, cluster_name, **ccm_options)
534528
CCM_CLUSTER.set_configuration_options({'start_native_transport': True})
535529
CCM_CLUSTER.set_configuration_options({'batch_size_warn_threshold_in_kb': 5})
536-
if dse_version >= Version('5.0'):
530+
if Version(dse_version) >= Version('5.0'):
537531
CCM_CLUSTER.set_configuration_options({'enable_user_defined_functions': True})
538532
CCM_CLUSTER.set_configuration_options({'enable_scripted_user_defined_functions': True})
539533
if dse_version >= Version('5.1'):
@@ -555,7 +549,7 @@ def use_cluster(cluster_name, nodes, ipformat=None, start=True, workloads=None,
555549
})
556550
if 'spark' in workloads:
557551
config_options = {"initial_spark_worker_resources": 0.1}
558-
if dse_version >= Version('6.7'):
552+
if Version(dse_version) >= Version('6.7'):
559553
log.debug("Disabling AlwaysON SQL for a DSE 6.7 Cluster")
560554
config_options['alwayson_sql_options'] = {'enabled': False}
561555
CCM_CLUSTER.set_dse_configuration_options(config_options)
@@ -567,9 +561,9 @@ def use_cluster(cluster_name, nodes, ipformat=None, start=True, workloads=None,
567561
else:
568562
CCM_CLUSTER = CCMCluster(path, cluster_name, **ccm_options)
569563
CCM_CLUSTER.set_configuration_options({'start_native_transport': True})
570-
if cassandra_version >= Version('2.2'):
564+
if Version(cassandra_version) >= Version('2.2'):
571565
CCM_CLUSTER.set_configuration_options({'enable_user_defined_functions': True})
572-
if cassandra_version >= Version('3.0'):
566+
if Version(cassandra_version) >= Version('3.0'):
573567
CCM_CLUSTER.set_configuration_options({'enable_scripted_user_defined_functions': True})
574568
common.switch_cluster(path, cluster_name)
575569
CCM_CLUSTER.set_configuration_options(configuration_options)

0 commit comments

Comments
 (0)