Skip to content

Commit 4498285

Browse files
committed
Extend maximum expiration date
1 parent e0d3cc9 commit 4498285

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

client_request_metrics_local_remote_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test_batch_and_slice(self):
5959
# Run batch test:
6060
query = 'BEGIN BATCH '
6161
for i in murmur3_hashes.keys():
62-
for y in range(0, 50):
62+
for y in range(0, 40):
6363
query += "INSERT INTO ks.test (id, ord, val) VALUES ({}, {}, 'aaa')".format(i, y)
6464
query += 'APPLY BATCH;'
6565
session.execute(query)

ttl_test.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,20 @@ def test_expiration_overflow_policy_reject(self):
362362
def test_expiration_overflow_policy_reject_default_ttl(self):
363363
self._base_expiration_overflow_policy_test(default_ttl=True, policy='REJECT')
364364

365+
@since('4.2')
366+
def test_expiration_overflow_policy_none(self):
367+
self._base_expiration_overflow_policy_test(default_ttl=False, policy='NONE')
368+
369+
@since('4.2')
370+
def test_expiration_overflow_policy_none_default_ttl(self):
371+
self._base_expiration_overflow_policy_test(default_ttl=True, policy='NONE')
372+
365373
def _base_expiration_overflow_policy_test(self, default_ttl, policy):
366374
"""
367375
Checks that expiration date overflow policy is correctly applied
368-
@jira_ticket CASSANDRA-14092
376+
@jira_ticket CASSANDRA-14092 and CASSANDRA-14227
377+
378+
Notice this is using the legacy 20y limitation. Newer versions support up to 68y
369379
"""
370380
MAX_TTL = 20 * 365 * 24 * 60 * 60 # 20 years in seconds
371381
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):
402412
assert_row_count(self.session1, 'ttl_table', 0 if policy == 'REJECT' else 1)
403413

404414
# Check that warning is always logged, unless policy is REJECT
405-
if policy != 'REJECT':
415+
if policy != 'REJECT' and policy != 'NONE':
406416
node1 = self.cluster.nodelist()[0]
407417
prefix = 'default ' if default_ttl else ''
408418
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):
599609
node.watch_log_for('Loading new SSTables', timeout=10)
600610

601611
logger.debug("Check that there are no rows present")
602-
assert_row_count(session, 'ttl_table', 0)
612+
# CASSANDRA-14227 4.2 upwards we have long TTL that can read overflowed rows
613+
if self.cluster.version() >= '4.2':
614+
assert_row_count(session, 'ttl_table', 1)
615+
else:
616+
assert_row_count(session, 'ttl_table', 0)
603617

604618
logger.debug("Shutting down node")
605619
self.cluster.stop()

upgrade_tests/upgrade_through_versions_test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ def upgrade_scenario(self, populate=True, create_schema=True, rolling=False, aft
431431

432432
self.upgrade_to_version(version_meta, partial=True, nodes=(node,), internode_ssl=internode_ssl)
433433

434+
logger.debug(str(self.fixture_dtest_setup.subprocs))
434435
self._check_on_subprocs(self.fixture_dtest_setup.subprocs)
435436
logger.debug('Successfully upgraded %d of %d nodes to %s' %
436437
(num + 1, len(self.cluster.nodelist()), version_meta.version))
@@ -488,7 +489,7 @@ def _check_on_subprocs(self, subprocs):
488489
if not all(subproc_statuses):
489490
message = "A subprocess has terminated early. Subprocess statuses: "
490491
for s in subprocs:
491-
message += "{name} (is_alive: {aliveness}), ".format(name=s.name, aliveness=s.is_alive())
492+
message += "{name} (is_alive: {aliveness}, exitCode: {exitCode}), ".format(name=s.name, aliveness=s.is_alive(), exitCode=s.exitcode)
492493
message += "attempting to terminate remaining subprocesses now."
493494
self._terminate_subprocs()
494495
raise RuntimeError(message)
@@ -653,7 +654,7 @@ def _start_continuous_write_and_verify(self, wait_for_rowcount=0, max_wait_s=600
653654
# queue of verified writes, which are update candidates
654655
verification_done_queue = Queue(maxsize=500)
655656

656-
writer = Process(target=data_writer, args=(self, to_verify_queue, verification_done_queue, 25))
657+
writer = Process(name="data_writer", target=data_writer, args=(self, to_verify_queue, verification_done_queue, 25))
657658
# daemon subprocesses are killed automagically when the parent process exits
658659
writer.daemon = True
659660
self.fixture_dtest_setup.subprocs.append(writer)
@@ -662,7 +663,7 @@ def _start_continuous_write_and_verify(self, wait_for_rowcount=0, max_wait_s=600
662663
if wait_for_rowcount > 0:
663664
self._wait_until_queue_condition('rows written (but not verified)', to_verify_queue, operator.ge, wait_for_rowcount, max_wait_s=max_wait_s)
664665

665-
verifier = Process(target=data_checker, args=(self, to_verify_queue, verification_done_queue))
666+
verifier = Process(name="data_checker", target=data_checker, args=(self, to_verify_queue, verification_done_queue))
666667
# daemon subprocesses are killed automagically when the parent process exits
667668
verifier.daemon = True
668669
self.fixture_dtest_setup.subprocs.append(verifier)

0 commit comments

Comments
 (0)