[Java] Preserve CoderTranslatorRegistrar binary compatibility - #39919
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #39919 +/- ##
============================================
- Coverage 58.34% 57.21% -1.13%
+ Complexity 13477 3659 -9818
============================================
Files 2568 1195 -1373
Lines 268731 193521 -75210
Branches 11028 3831 -7197
============================================
- Hits 156791 110728 -46063
+ Misses 106002 79226 -26776
+ Partials 5938 3567 -2371
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Run Java_IOs_Direct PreCommit |
|
Assigning reviewers: R: @ahmedabu98 for label java. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
|
R: @acrites |
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
|
Thanks for the fix! |
|
|
||
| ## Bugfixes | ||
|
|
||
| * (Java) Restored binary compatibility for `CoderTranslatorRegistrar` implementations compiled against Beam 2.76 and earlier ([#38714](https://github.com/apache/beam/issues/38714)). |
There was a problem hiding this comment.
#39594 isn't in any Beam release yet so there is no need to add a CHANGES.md item to remind users.
Addresses #38714.
Problem
The nightly snapshot workflow started failing consistently after #39594 merged. Both affected Dataflow jobs reach
SplitWithSizing, then repeatedly lose their Java SDK harness.#39594 added three abstract methods to the public
CoderTranslatorRegistrarSPI. Development SDK jobs use the pinnedbeam-master-20260731Dataflow worker container, whose registrar implementations were compiled before those methods existed. Calling a new method on one of those implementations is binary-incompatible and throwsAbstractMethodError, terminating the harness.Public workflow logs contain the resulting harness disconnects, while worker diagnostics require access to the
apache-beam-testingproject. I verified the underlying failure directly by compiling a registrar against the parent of #39594 and running that unchanged bytecode with currentbeam-sdks-java-core. It fails with:Fix
Provide default implementations for the three new lookup methods using the two maps already required by the older SPI. Existing registrars remain loadable across the SDK/container version boundary.
ModelCoderRegistrarkeeps its option-aware overrides, including SchemaCoder update-compatibility behavior.Regression coverage uses a registrar that implements only the pre-2.77 methods. The same separately compiled legacy bytecode also runs successfully after this change.
Validation
All passed locally.
CHANGES.mdwith the binary-compatibility fix.