Skip to content

Commit

Permalink
tests/topic_delete_test: wait for all uploads before deleting topics
Browse files Browse the repository at this point in the history
As soon as a topic is deleted, raft is shut down.  This prevents
ntp_archiver from updating archival_metadata_stm after uploading
a segment, resulting in an orphan segment after deletion.

Fixes redpanda-data#8496
Fixes redpanda-data#10655
  • Loading branch information
jcsp committed Jun 23, 2023
1 parent b63459d commit 8355e4e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/rptest/tests/topic_delete_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from rptest.util import wait_for_local_storage_truncate, firewall_blocked
from rptest.services.admin import Admin
from rptest.tests.partition_movement import PartitionMovementMixin
from rptest.utils.si_utils import BucketView, NTP, NT, LifecycleMarkerStatus
from rptest.utils.si_utils import BucketView, NTP, NT, LifecycleMarkerStatus, quiesce_uploads


def get_kvstore_topic_key_counts(redpanda):
Expand Down Expand Up @@ -470,10 +470,9 @@ def _populate_topic(self,
else:
self._produce_until_spillover(topic_name, local_retention)

# Confirm objects in remote storage
objects = self.cloud_storage_client.list_objects(
self.si_settings.cloud_storage_bucket, topic=topic_name)
assert sum(1 for _ in objects) > 0
# Wait for everything to be uploaded: this avoids tests potentially trying
# to delete topics mid-uploads, which can leave orphan segments.
quiesce_uploads(self.redpanda, topic_name, timeout_sec=60)

@skip_debug_mode # Rely on timely uploads during leader transfers
@cluster(num_nodes=3,
Expand Down

0 comments on commit 8355e4e

Please sign in to comment.