Skip to content

[Java] Preserve CoderTranslatorRegistrar binary compatibility - #39919

Merged
stankiewicz merged 1 commit into
apache:masterfrom
bvolpato:bvolpato/fix-coder-registrar-compatibility
Aug 31, 2026
Merged

[Java] Preserve CoderTranslatorRegistrar binary compatibility#39919
stankiewicz merged 1 commit into
apache:masterfrom
bvolpato:bvolpato/fix-coder-registrar-compatibility

Conversation

@bvolpato

Copy link
Copy Markdown
Contributor

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 CoderTranslatorRegistrar SPI. Development SDK jobs use the pinned beam-master-20260731 Dataflow worker container, whose registrar implementations were compiled before those methods existed. Calling a new method on one of those implementations is binary-incompatible and throws AbstractMethodError, terminating the harness.

Public workflow logs contain the resulting harness disconnects, while worker diagnostics require access to the apache-beam-testing project. I verified the underlying failure directly by compiling a registrar against the parent of #39594 and running that unchanged bytecode with current beam-sdks-java-core. It fails with:

java.lang.AbstractMethodError: Receiver class LegacyRegistrar does not define or inherit an implementation of the resolved method 'abstract boolean isKnownCoder(...)'

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. ModelCoderRegistrar keeps 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

./gradlew :sdks:java:core:spotlessCheck
./gradlew :sdks:java:core:test
./gradlew :runners:google-cloud-dataflow-java:test --tests 'org.apache.beam.runners.dataflow.DataflowPipelineTranslatorTest'
./gradlew :sdks:java:harness:test --tests 'org.apache.beam.fn.harness.state.StateBackedIterableTest'

All passed locally.


  • Mention the appropriate issue in the description.
  • Update CHANGES.md with the binary-compatibility fix.
  • This contribution is small and does not require an ICLA update.

@github-actions github-actions Bot added the java label Aug 30, 2026
@codecov

codecov Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.21%. Comparing base (25cb8b7) to head (63e2a25).
⚠️ Report is 1 commits behind head on master.

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     
Flag Coverage Δ
java 72.18% <ø> (+7.72%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bvolpato

Copy link
Copy Markdown
Contributor Author

Run Java_IOs_Direct PreCommit

@bvolpato
bvolpato marked this pull request as ready for review August 30, 2026 13:55
@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @ahmedabu98 for label java.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@stankiewicz

Copy link
Copy Markdown
Contributor

R: @acrites

@github-actions

Copy link
Copy Markdown
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

@acrites

acrites commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Thanks for the fix!

@acrites acrites 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.

Looks good to me!

@stankiewicz
stankiewicz merged commit 7ada585 into apache:master Aug 31, 2026
29 of 30 checks passed
Comment thread CHANGES.md

## Bugfixes

* (Java) Restored binary compatibility for `CoderTranslatorRegistrar` implementations compiled against Beam 2.76 and earlier ([#38714](https://github.com/apache/beam/issues/38714)).

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.

#39594 isn't in any Beam release yet so there is no need to add a CHANGES.md item to remind users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants