flink icon indicating copy to clipboard operation
flink copied to clipboard

[FLINK-39674][formats] Upgrade Confluent Schema Registry client

Open qiuyanjun888 opened this issue 5 months ago • 2 comments

Summary

This PR updates flink-avro-confluent-registry to a newer Confluent Schema Registry client and adds a focused regression test for Kafka 3.9.x OAuth compatibility.

Root Cause

flink-avro-confluent-registry still used io.confluent:kafka-schema-registry-client:7.5.3. With Kafka client 3.9.x on the classpath, the Schema Registry OAuth bearer path can fail during client initialization because Confluent 7.5.3 calls the old HttpAccessTokenRetriever constructor signature that is no longer present in Kafka 3.9.x.

Changes

  • Upgrade io.confluent:kafka-schema-registry-client from 7.5.3 to 7.9.8.
  • Add a test-scoped Kafka 3.9.2 dependency for compatibility validation.
  • Add a focused regression test that initializes the Schema Registry OAuth bearer credential path with Kafka 3.9.2 on the test classpath.

Validation

  • Added RED regression coverage:
    • ./mvnw -pl flink-formats/flink-avro-confluent-registry -Dtest=CachedSchemaCoderProviderTest#testThatOauthBearerAuthIsCompatibleWithKafkaClient39 test -DskipITs -Drat.skip=true -Dcheckstyle.skip=true
    • Fails before the dependency upgrade with NoSuchMethodError from OauthCredentialProvider.getTokenRetriever(...).
  • Verified GREEN after the upgrade:
    • ./mvnw -pl flink-formats/flink-avro-confluent-registry -Dtest=CachedSchemaCoderProviderTest#testThatOauthBearerAuthIsCompatibleWithKafkaClient39 test -DskipITs -Drat.skip=true -Dcheckstyle.skip=true
  • Ran the module test suite:
    • ./mvnw -pl flink-formats/flink-avro-confluent-registry test -DskipITs
    • Result: 28 tests, 0 failures, 0 errors; checkstyle and spotless clean.
  • Verified the final dependency tree includes:
    • io.confluent:kafka-schema-registry-client:7.9.8
    • org.apache.kafka:kafka-clients:3.9.2 in test scope.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): yes
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

Was generative AI tooling used to co-author this PR?
  • [X] Yes, Hermes Agent with OpenAI GPT-5.5

Generated-by: Hermes Agent (OpenAI GPT-5.5)

qiuyanjun888 avatar Jun 22 '26 14:06 qiuyanjun888

CI report:

  • 7ab14140868e247a812e4497ac99c220b32b9f33 Azure: FAILURE
Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

flinkbot avatar Jun 22 '26 14:06 flinkbot

This PR is focused on formats / Avro Confluent Registry client upgrade. There has already been community review/comment, but it still needs maintainer review.

@MartijnVisser @snuyanzin @pnowojski could you please take a look when you have time and advise whether this approach is acceptable for this area and can move forward?

qiuyanjun888 avatar Jun 26 '26 02:06 qiuyanjun888

@qiuyanjun888 The CI has failed for this PR, so even with a review it's not yet mergable. Can you take a look at the failures ?

MartijnVisser avatar Jul 03 '26 06:07 MartijnVisser

@MartijnVisser I checked the Azure failures. The blocking issue was the license check for flink-sql-avro-confluent-registry:

  • com.github.luben:zstd-jni:1.5.6-4 was not listed
  • com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.21.3 was not listed
  • the old com.github.luben:zstd-jni:1.5.5-1 entry was still listed

Pushed 7ab14140868e247a812e4497ac99c220b32b9f33 to update the SQL module META-INF/NOTICE accordingly.

Local validation:

  • git diff --check
  • targeted package build for flink-formats/flink-sql-avro-confluent-registry
  • inspected the built JAR META-INF/NOTICE
  • tools/ci/license_check.sh on the targeted validation deployment completed without severe issues

qiuyanjun888 avatar Jul 04 '26 07:07 qiuyanjun888

@flinkbot run azure

qiuyanjun888 avatar Jul 04 '26 07:07 qiuyanjun888

@flinkbot run azure

qiuyanjun888 avatar Jul 08 '26 00:07 qiuyanjun888