Skip to content

dt/tests: declare Kafka 4.2 in sarama compatibility tests#31073

Open
nguyen-andrew wants to merge 1 commit into
redpanda-data:devfrom
nguyen-andrew:sarama-declare-kafka-4x
Open

dt/tests: declare Kafka 4.2 in sarama compatibility tests#31073
nguyen-andrew wants to merge 1 commit into
redpanda-data:devfrom
nguyen-andrew:sarama-declare-kafka-4x

Conversation

@nguyen-andrew

@nguyen-andrew nguyen-andrew commented Jul 10, 2026

Copy link
Copy Markdown
Member

The Sarama compatibility ducktape tests pinned a low declared Kafka
protocol version (2.1/2.6) because older Sarama did not auto-negotiate
API versions: declaring a newer version would make it send request
versions the broker might not support. Since v1.46 (and the pinned
v1.48.0), Sarama negotiates and clamps down to the broker's advertised
versions like the other validated clients, so declaring a 4.x version
is safe.

This adds Kafka 4.2.0 (the v1.48.0 library's max) to the declared-version
matrix in the Sarama tests, alongside the existing 2.1.0 and 2.6.0, so CI
validates Sarama against Kafka 4.x. The legacy max_timestamp fixture
test is intentionally left on its old declared version.

Related to CORE-16243

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

Sarama negotiates API versions and clamps down to the broker since
v1.46, so declaring 4.x no longer risks sending requests the broker
rejects. Add Kafka 4.2 (the pinned v1.48.0 library's max) to the
declared-version matrix, alongside the existing 2.1 and 2.6.
Copilot AI review requested due to automatic review settings July 10, 2026 18:45
@nguyen-andrew nguyen-andrew self-assigned this Jul 10, 2026

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

Expands the Sarama ducktape compatibility test matrix to declare Kafka protocol version 4.2.0 (in addition to 2.1.0 and 2.6.0), aligning with Sarama v1.48.0’s maximum supported Kafka version so CI validates Sarama behavior against 4.x.

Changes:

  • Add 4.2.0 to the declared Kafka version matrix for Sarama example-based compatibility tests.
  • Add 4.2.0 to the Sarama produce compatibility test matrix.
  • Update the Go produce-test binary’s default --version to 4.2.0.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/rptest/tests/compatibility/sarama_test.py Extends declared Kafka version matrix for Sarama example tests to include 4.2.0.
tests/rptest/tests/compatibility/sarama_produce_test.py Extends Sarama produce test matrix to include 4.2.0.
tests/go/sarama/produce_test/main.go Changes default --version flag value to 4.2.0 (help text nit noted).

brokers = flag.String("brokers", "127.0.0.1:9092", "Th Redpanda brokers to connect to, as a comma separated list")
count = flag.Int64("count", 100, "Optional count to run")
version = flag.String("version", "2.1.0", "Kafka version to use, e.g. 2.1.0")
version = flag.String("version", "4.2.0", "Kafka version to use, e.g. 2.1.0")
@vbotbuildovich

Copy link
Copy Markdown
Collaborator

CI test results

test results on build#86975
test_status test_class test_method test_arguments test_kind job_url passed reason test_history
FLAKY(PASS) ShadowLinkTopicFailoverTests test_producer_ids_failover {"storage_mode": "tiered_cloud"} integration https://buildkite.com/redpanda/redpanda/builds/86975#019f4d62-7858-4349-bd70-faa0d8dfff7b 10/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0077, 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=ShadowLinkTopicFailoverTests&test_method=test_producer_ids_failover

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