Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v24.1.x] [CORE-1478] rptest: fix retention value in archive_retention_test #24062

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions tests/rptest/tests/archive_retention_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ def new_manifest_spilled():
# will be deleted (in case of retention.ms)
time.sleep(2)

retention_value = 1000 # 1KiB or 1s
self.logger.debug(f"Setting {retention_type} to {retention_value}")

for part_id in range(0, topic.partition_count):
ntp = NTP(ns='kafka', topic=topic.name, partition=part_id)
summaries = view.segment_summaries(ntp)
if retention_type == 'retention.bytes':
retention_value = max(
min(summaries, key=lambda s: s.size_bytes).size_bytes - 1,
0)
segments_to_delete = len(summaries)
else:
retention_value = 1000 # 1s
Expand All @@ -198,6 +198,8 @@ def new_manifest_spilled():
if s.base_timestamp < (current_time - retention_value)
])

self.logger.debug(f"Setting {retention_type} to {retention_value}")

# Note: altering the topic config will re-init the archiver and
# reset the metric tracking segment deletion. This is why we assign
# to `segments_to_delete` instead of adding.
Expand Down
Loading