From a050899a1073a8fb2b8fa6483f9db39d345f5c61 Mon Sep 17 00:00:00 2001 From: Travis Bischel Date: Mon, 23 Oct 2023 15:06:04 -0600 Subject: [PATCH] .github, txn docs: use Kafka 3.6, avoid KAFKA-15653, doc deprecated option --- .github/workflows/lint-and-test.yml | 6 +++--- pkg/kgo/txn.go | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 632ff551..c97687ce 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -34,10 +34,10 @@ jobs: needs: golangci runs-on: ubuntu-latest name: "integration test kafka" - container: golang:1.20.3 + container: golang:1.21.3 services: kafka: - image: bitnami/kafka:3.5 + image: bitnami/kafka:latest ports: - 9092:9092 env: @@ -47,6 +47,7 @@ jobs: KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093 KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 1@127.0.0.1:9093 + KAFKA_CFG_TRANSACTION_PARTITION_VERIFICATION_ENABLE: false # Set this to "PLAINTEXT://127.0.0.1:9092" if you want to run this container on localhost via Docker KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 KAFKA_CFG_NODE_ID: 1 @@ -58,7 +59,6 @@ jobs: env: KGO_TEST_RF: 1 KGO_SEEDS: kafka:9092 - KGO_TEST_UNSAFE: true KGO_TEST_STABLE_FETCH: true integration-test-redpanda: diff --git a/pkg/kgo/txn.go b/pkg/kgo/txn.go index a4cb8bcf..7df9c65e 100644 --- a/pkg/kgo/txn.go +++ b/pkg/kgo/txn.go @@ -511,6 +511,14 @@ const ( // This relies on Kafka internals. Some brokers (notably Redpanda) are // more strict with enforcing transaction correctness and this option // cannot be used and will cause errors. + // + // Deprecated: Kafka 3.6 removed support for the hacky behavior that + // this option was abusing. Thus, as of Kafka 3.6, this option does not + // work against Kafka. This option also has never worked for Redpanda + // becuse Redpanda always strictly validated that partitions were a + // part of a transaction. Later versions of Kafka and Redpanda will + // remove the need for AddPartitionsToTxn at all and thus this option + // ultimately will be unnecessary anyway. EndBeginTxnUnsafe )