Skip to content

[improve][io] Align the OpenMLDB module's forced protobuf with the platform version#106

Open
david-streamlio wants to merge 1 commit into
apache:masterfrom
david-streamlio:fix/openmldb-protobuf-force-version
Open

[improve][io] Align the OpenMLDB module's forced protobuf with the platform version#106
david-streamlio wants to merge 1 commit into
apache:masterfrom
david-streamlio:fix/openmldb-protobuf-force-version

Conversation

@david-streamlio

Copy link
Copy Markdown
Contributor

Motivation

Follow-up to #105. That PR forced protobuf-java to 3.21.12 in the OpenMLDB module with a comment claiming makeExtensionsImmutable() was "removed in protobuf-java 3.22". While root-causing the same symptom in the Canal module (#98/#99), that claim was disproven empirically: the method survives through the entire 3.25.x line and was removed in protobuf-java 4.x.

The NoSuchMethodError the force works around is actually caused by the test classpath resolving protobuf 4.x by conflict resolution — io.kubernetes:client-java (a transitive of the test-only pulsar-functions-instance) requests 4.29.3, outranking the platform's 3.25.5:

com.google.protobuf:protobuf-java:4.29.3
   Selection reasons:
      - By conflict resolution: between versions 4.29.3, 3.25.8, 3.25.5 and 3.16.3
+--- io.kubernetes:client-java:23.0.0
     \--- org.apache.pulsar:pulsar-functions-secrets:4.2.0
          \--- org.apache.pulsar:pulsar-functions-instance:4.2.0  (testImplementation)

Modifications

Bump the forced version from 3.21.12 to 3.25.5 and correct the comment. 3.25.5 is the platform's pinned version and the same protobuf line the Pulsar runtime provides to the NAR in production (NARs never bundle protobuf), so the test classpath now matches what the connector actually runs against — and the module stops pinning to an older release than necessary.

Verifying this change

Run on Linux x86-64 (Ubuntu 24.04, Docker 29.1.3, OpenJDK 21):

$ ./gradlew :jdbc:pulsar-io-jdbc-openmldb:test --rerun-tasks

Gradle suite > Gradle test > org.apache.pulsar.io.jdbc.OpenMLDBJdbcSinkIntegrationTest > testOpenWritesAndReadsBack PASSED

BUILD SUCCESSFUL in 1m 37s

Documentation

  • doc-not-needed (build/test dependency alignment)

…atform version

Follow-up to apache#105, which forced protobuf-java to 3.21.12 with a comment
claiming makeExtensionsImmutable() was removed in protobuf 3.22. That
was wrong: the method survives through the whole 3.25.x line and was
removed in protobuf-java 4.x. The NoSuchMethodError the force works
around is caused by the TEST classpath resolving protobuf 4.x by
conflict resolution (io.kubernetes:client-java, a transitive of the
test-only pulsar-functions-instance, requests it), not by the
platform's 3.25.5.

Force 3.25.5 instead: the platform version and the same protobuf line
the Pulsar runtime provides to the NAR in production, so the test
classpath now matches what the connector actually runs against.

Verified on Linux x86-64: OpenMLDBJdbcSinkIntegrationTest passes with
the 3.25.5 force.

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

Aligns the OpenMLDB JDBC connector module’s protobuf dependency forcing with the repository platform pin, ensuring the OpenMLDB integration test classpath matches the protobuf version provided by the Pulsar runtime (and avoids protobuf 4.x NoSuchMethodError during tests).

Changes:

  • Update the OpenMLDB module’s resolutionStrategy.force for protobuf-java to 3.25.5 (platform version).
  • Correct and expand the in-file rationale comment to reflect that the breaking change is in protobuf-java 4.x and that the conflict arises on the test classpath.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"org.apache.curator:curator-framework:4.2.0",
"org.apache.curator:curator-recipes:4.2.0",
"com.google.protobuf:protobuf-java:3.21.12",
"com.google.protobuf:protobuf-java:3.25.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.

2 participants