From 5cdfdd9ba374c6871a55354774efefda70b72bf6 Mon Sep 17 00:00:00 2001 From: Calle Wilund Date: Tue, 5 May 2026 14:42:55 +0200 Subject: [PATCH] commitlog_test.py: Fix size check aliasing, and threshold calc. Fixes: SCYLLADB-1815 Checking segment sizes should not use a size filter that rounds (up) sizes. More importantly, the estimate for what is acceptable limit for commitlog disk usage should be aligned. Simplified the calc, and also made logging more useful in case of failure. --- test/cluster/dtest/commitlog_test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/cluster/dtest/commitlog_test.py b/test/cluster/dtest/commitlog_test.py index a8f39c06c1..cd1a8a66c3 100644 --- a/test/cluster/dtest/commitlog_test.py +++ b/test/cluster/dtest/commitlog_test.py @@ -94,7 +94,7 @@ class TestCommitLog(Tester): files = glob.glob(f"{path}/*CommitLog-*.log") if not files: return 0, "" if include_stdout else 0 - cmd_args = ["du", "-m"] + cmd_args = ["du", "-b"] cmd_args.extend(files) p = subprocess.Popen(cmd_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = p.communicate() @@ -118,7 +118,7 @@ class TestCommitLog(Tester): size += int(a[0]) else: logger.warning(f"Unrecognized du output line: {l}") - return size, stdout.decode() if include_stdout else size + return size / (1024*1024), stdout.decode() if include_stdout else size def _segment_size_test(self, segment_size_in_mb, compressed=False): """Execute a basic commitlog test and validate the commitlog files""" @@ -474,12 +474,12 @@ class TestCommitLog(Tester): reach_threshold_cases = [] # Scylla allows to create one more commitlog file out of the space limit # and commitlog segments may be go over commitlog_segment_size_in_mb in 1MB as well. - actual_space_limit = (total_space_limit // commitlog_segment_size_in_mb + 1) * (commitlog_segment_size_in_mb + 1) + actual_space_limit = total_space_limit + commitlog_segment_size_in_mb + 1 def check_commitlog_size(allow_errors: bool): dir_size, stdout = self._get_commitlog_size(include_stdout=True, allow_errors=allow_errors) if dir_size > actual_space_limit and not allow_errors: - logger.debug(f"Commitlog file sizes in MB:\n{stdout}") + logger.info(f"Commitlog file sizes in MB:\n{stdout}") assert dir_size <= actual_space_limit, f"Out of total space limit\n" return dir_size