From fac04689aa6b12f29aed04ffdc2a04ba626a74bb 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 | 10 +++++----- pkg/kgo/txn.go | 8 ++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 632ff551..351c39f7 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.20.3 + go-version: 1.21.3 - uses: golangci/golangci-lint-action@v3 with: version: latest @@ -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: @@ -66,7 +66,7 @@ jobs: needs: golangci runs-on: ubuntu-latest name: "integration test redpanda" - container: golang:1.20.3 + container: golang:1.21.3 services: redpanda: image: vectorized/redpanda-nightly:latest 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 )