diff --git a/client_request_metrics_local_remote_test.py b/client_request_metrics_local_remote_test.py index 476d462690..026565d11c 100644 --- a/client_request_metrics_local_remote_test.py +++ b/client_request_metrics_local_remote_test.py @@ -59,7 +59,7 @@ def test_batch_and_slice(self): # Run batch test: query = 'BEGIN BATCH ' for i in murmur3_hashes.keys(): - for y in range(0, 50): + for y in range(0, 40): query += "INSERT INTO ks.test (id, ord, val) VALUES ({}, {}, 'aaa')".format(i, y) query += 'APPLY BATCH;' session.execute(query) diff --git a/ttl_test.py b/ttl_test.py index 7416e9c34f..f13ea59b15 100644 --- a/ttl_test.py +++ b/ttl_test.py @@ -362,10 +362,20 @@ def test_expiration_overflow_policy_reject(self): def test_expiration_overflow_policy_reject_default_ttl(self): self._base_expiration_overflow_policy_test(default_ttl=True, policy='REJECT') + @since('4.2') + def test_expiration_overflow_policy_none(self): + self._base_expiration_overflow_policy_test(default_ttl=False, policy='NONE') + + @since('4.2') + def test_expiration_overflow_policy_none_default_ttl(self): + self._base_expiration_overflow_policy_test(default_ttl=True, policy='NONE') + def _base_expiration_overflow_policy_test(self, default_ttl, policy): """ Checks that expiration date overflow policy is correctly applied - @jira_ticket CASSANDRA-14092 + @jira_ticket CASSANDRA-14092 and CASSANDRA-14227 + + Notice this is using the legacy 20y limitation. Newer versions support up to 68y """ MAX_TTL = 20 * 365 * 24 * 60 * 60 # 20 years in seconds default_time_to_live = MAX_TTL if default_ttl else None @@ -402,7 +412,7 @@ def _base_expiration_overflow_policy_test(self, default_ttl, policy): assert_row_count(self.session1, 'ttl_table', 0 if policy == 'REJECT' else 1) # Check that warning is always logged, unless policy is REJECT - if policy != 'REJECT': + if policy != 'REJECT' and policy != 'NONE': node1 = self.cluster.nodelist()[0] prefix = 'default ' if default_ttl else '' warning = node1.grep_log("Request on table {}.{} with {}ttl of {} seconds exceeds maximum supported expiration" @@ -599,7 +609,11 @@ def test_recover_negative_expiration_date_sstables_with_scrub(self): node.watch_log_for('Loading new SSTables', timeout=10) logger.debug("Check that there are no rows present") - assert_row_count(session, 'ttl_table', 0) + # CASSANDRA-14227 4.2 upwards we have long TTL that can read overflowed rows + if self.cluster.version() >= '4.2': + assert_row_count(session, 'ttl_table', 1) + else: + assert_row_count(session, 'ttl_table', 0) logger.debug("Shutting down node") self.cluster.stop() diff --git a/upgrade_tests/upgrade_through_versions_test.py b/upgrade_tests/upgrade_through_versions_test.py index 47f54281a1..878aba7f4e 100644 --- a/upgrade_tests/upgrade_through_versions_test.py +++ b/upgrade_tests/upgrade_through_versions_test.py @@ -430,6 +430,7 @@ def upgrade_scenario(self, populate=True, create_schema=True, rolling=False, aft self.upgrade_to_version(version_meta, partial=True, nodes=(node,), internode_ssl=internode_ssl) + logger.debug(str(self.fixture_dtest_setup.subprocs)) self._check_on_subprocs(self.fixture_dtest_setup.subprocs) logger.debug('Successfully upgraded %d of %d nodes to %s' % (num + 1, len(self.cluster.nodelist()), version_meta.version)) @@ -485,7 +486,7 @@ def _check_on_subprocs(self, subprocs): if not all(subproc_statuses): message = "A subprocess has terminated early. Subprocess statuses: " for s in subprocs: - message += "{name} (is_alive: {aliveness}), ".format(name=s.name, aliveness=s.is_alive()) + message += "{name} (is_alive: {aliveness}, exitCode: {exitCode}), ".format(name=s.name, aliveness=s.is_alive(), exitCode=s.exitcode) message += "attempting to terminate remaining subprocesses now." self._terminate_subprocs() raise RuntimeError(message) @@ -648,7 +649,7 @@ def _start_continuous_write_and_verify(self, wait_for_rowcount=0, max_wait_s=600 # queue of verified writes, which are update candidates verification_done_queue = Queue(maxsize=500) - writer = Process(target=data_writer, args=(self, to_verify_queue, verification_done_queue, 25)) + writer = Process(name="data_writer", target=data_writer, args=(self, to_verify_queue, verification_done_queue, 25)) # daemon subprocesses are killed automagically when the parent process exits writer.daemon = True self.fixture_dtest_setup.subprocs.append(writer) @@ -657,7 +658,7 @@ def _start_continuous_write_and_verify(self, wait_for_rowcount=0, max_wait_s=600 if wait_for_rowcount > 0: self._wait_until_queue_condition('rows written (but not verified)', to_verify_queue, operator.ge, wait_for_rowcount, max_wait_s=max_wait_s) - verifier = Process(target=data_checker, args=(self, to_verify_queue, verification_done_queue)) + verifier = Process(name="data_checker", target=data_checker, args=(self, to_verify_queue, verification_done_queue)) # daemon subprocesses are killed automagically when the parent process exits verifier.daemon = True self.fixture_dtest_setup.subprocs.append(verifier)