8000 fix(inkless:test): query topic state from a controller host in switch tests by giuseppelillo · Pull Request #917 · aiven/inkless · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@giuseppelillo
Copy link
Copy Markdown
Contributor

The switch test helpers ran kafka-topics --describe on the first running broker. When that broker is the one a network partition cuts off, the leader check can't get an answer. --describe also sends ListPartitionReassignments to a random unfenced broker, and the cut-off broker is still unfenced. If the pick is a broker the query node can't reach, the command waits out the 60 s client timeout.

In the nightly run of test_fault_before_control_plane_init with hold=replication and fault=leader_sigkill (run), two such attempts used up the 120 s budget of _wait_for_all_partitions_have_leaders. Every partition had a leader 7 s after the kill: the DescribeTopicPartitions responses on the query broker list a leader for all 6 partitions. Both attempts got controllerId 2 in their Metadata responses, a broker the query broker couldn't reach, and no broker logged a ListPartitionReassignments request. Querying from another broker doesn't help, because that broker can draw the cut-off broker.

The leader, ISR, and full-ISR waits now run kafka-topics from a host of the isolated controller quorum. The network partitions in these tests list only brokers, so that host reaches every broker. The command still bootstraps against the brokers. Without an isolated quorum, the helpers fall back to the first running broker.

Test plan

  • python3 -m py_compile on the test file.
  • make vale reports no alerts.
  • Full Inkless system test suite on this branch: run 46453876190.

🤖 Generated with Claude Code

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.

🟢 Approval recommended

No active review issues are reported for the Inkless topic-switch query-host changes.

No open issues 🎉

What changed in this PR

This PR makes Inkless topic-switch tests more reliable during broker network partitions by running topic-state queries from a controller host that can reach all brokers.

Changes:

  • Adds a shared query-host selector that prefers an isolated controller host and otherwise uses the first running broker.
  • Applies the selector to leader, broker-ISR, and full-ISR waits while retaining broker bootstrap connections.
File Description
tests/​kafkatest/​tests/​inkless/​inkless_topic_switch_test.py Centralizes query-host selection and updates all three topic-state waits.

Review effort: Balanced

@giuseppelillo
giuseppelillo requested a review from gqmelo December 2, 2026 13:21
@gqmelo
gqmelo enabled auto-merge (squash) December 2, 2026 13:49
… tests

The switch test helpers ran `kafka-topics --describe` on the first running
broker. When that broker is the one a network partition cuts off, the leader
check can't get an answer: `--describe` also sends
`ListPartitionReassignments` to a random unfenced broker, and the cut-off
broker is still unfenced. If the pick is a broker the query node can't reach,
the command waits out the 60 s client timeout. Two such attempts used up the
120 s budget of `_wait_for_all_partitions_have_leaders` in the nightly run of
`test_fault_before_control_plane_init` with `fault=leader_sigkill`, although
every partition had a leader 7 s after the kill. Querying from another broker
doesn't help, because it can draw the cut-off broker.

The leader, ISR, and full-ISR waits now run `kafka-topics` from a host of the
isolated controller quorum. The network partitions in these tests list only
brokers, so that host reaches every broker. Without an isolated quorum, the
helpers fall back to the first running broker.

Assisted-by: Claude Opus 5.5
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

0