[improve][io] Align the OpenMLDB module's forced protobuf with the platform version#106
Open
david-streamlio wants to merge 1 commit into
Open
Conversation
…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.
Contributor
There was a problem hiding this comment.
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.forceforprotobuf-javato3.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", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Follow-up to #105. That PR forced
protobuf-javato 3.21.12 in the OpenMLDB module with a comment claimingmakeExtensionsImmutable()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
NoSuchMethodErrorthe 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-onlypulsar-functions-instance) requests 4.29.3, outranking the platform's 3.25.5: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):
Documentation
doc-not-needed(build/test dependency alignment)