Skip to content

[CORE-16779] rptest: add _call_with_leader_retry for metastore util functions#31017

Open
WillemKauf wants to merge 1 commit into
redpanda-data:devfrom
WillemKauf:worktree-fix-leveling-disjoint-flaky
Open

[CORE-16779] rptest: add _call_with_leader_retry for metastore util functions#31017
WillemKauf wants to merge 1 commit into
redpanda-data:devfrom
WillemKauf:worktree-fix-leveling-disjoint-flaky

Conversation

@WillemKauf

Copy link
Copy Markdown
Contributor

Tests can flake because of metastore RPCs returning transient UNAVAILABLE errors due to leadership movements.

Add a _call_with_leader_retry() function and wrap the existing metastore utilities in it.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v26.1.x
  • v25.3.x
  • v25.2.x

Release Notes

  • none

Tests can flake because of `metastore` RPCs returning transient `UNAVAILABLE`
errors due to leadership movements.

Add a `_call_with_leader_retry()` function and wrap the existing `metastore`
utilities in it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces rptest flakiness in cloud-topics tests by adding a small retry wrapper for metastore RPCs that can transiently fail with UNAVAILABLE during leadership changes.

Changes:

  • Add _call_with_leader_retry() to retry metastore RPCs on ConnectErrorCode.UNAVAILABLE.
  • Wrap read_rows, list_cloud_topics, and get_size calls in the new retry helper.

Comment on lines +21 to +28
deadline = time.time() + timeout_sec
while True:
try:
return call()
except ConnectError as e:
if e.code != ConnectErrorCode.UNAVAILABLE or time.time() >= deadline:
raise
time.sleep(backoff_sec)
@vbotbuildovich

Copy link
Copy Markdown
Collaborator

CI test results

test results on build#86730
test_status test_class test_method test_arguments test_kind job_url passed reason test_history
FLAKY(PASS) ConsumerGroupBalancingTest test_coordinator_nodes_balance null integration https://buildkite.com/redpanda/redpanda/builds/86730#019f29a6-6560-45d2-a668-47b5369da8e3 10/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0000, p0=1.0000, reject_threshold=0.0100. adj_baseline=0.1000, p1=0.3487, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=ConsumerGroupBalancingTest&test_method=test_coordinator_nodes_balance
FLAKY(PASS) DataMigrationsApiTest test_higher_level_migration_api null integration https://buildkite.com/redpanda/redpanda/builds/86730#019f29a6-655e-4691-9412-5b27aecb3844 10/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0000, p0=1.0000, reject_threshold=0.0100. adj_baseline=0.1000, p1=0.3487, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=DataMigrationsApiTest&test_method=test_higher_level_migration_api
FLAKY(PASS) DataMigrationsApiTest test_mount_inexistent null integration https://buildkite.com/redpanda/redpanda/builds/86730#019f29a6-655f-4101-a505-15e0f4fb67d6 10/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0000, p0=1.0000, reject_threshold=0.0100. adj_baseline=0.1000, p1=0.3487, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=DataMigrationsApiTest&test_method=test_mount_inexistent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants