Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BEAM-9743] Fix TFRecordCodec to try harder to read/write #11397

Merged
merged 4 commits into from Apr 17, 2020

Conversation

lukemin89
Copy link

@lukemin89 lukemin89 commented Apr 11, 2020

ReadableByteChannel/WritableByteChannel specifies that a single read/write request might be ignored, and read/write from 0 bytes to n bytes, where n is buffer.remaining(), even if there's more contents/space left in the channel.

A similar issue has been pointed out and dealt with once. https://issues.apache.org/jira/browse/BEAM-5412?jql=text%20~%20%22tfrecord%22

But the same issue can happen for header and footer as well, and when writing data.

I recently encountered this issue when trying to switch from GZIP compression to ZSTD compression.

Make it try harder to read/write header/footer/data.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • [ R: @lukecwik ] Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- Build Status --- --- Build Status
Java Build Status Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status
Build Status
Build Status
Python Build Status
Build Status
Build Status
Build Status
--- Build Status
Build Status
Build Status
Build Status
Build Status
--- --- Build Status
XLang --- --- --- Build Status --- --- Build Status

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website
Non-portable Build Status Build Status
Build Status
Build Status Build Status
Portable --- Build Status --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

@lukemin89 lukemin89 marked this pull request as ready for review April 11, 2020 09:41
@lukemin89 lukemin89 closed this Apr 13, 2020
@lukemin89 lukemin89 reopened this Apr 13, 2020
@lukemin89
Copy link
Author

R: @lukecwik

Copy link
Member

@lukecwik lukecwik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work on the tests.

@lukecwik
Copy link
Member

retest this please

@lukecwik lukecwik merged commit b6acaef into apache:master Apr 17, 2020
yirutang pushed a commit to yirutang/beam that referenced this pull request Jul 23, 2020
* [BEAM-9743] Fix TFRecordCodec to try harder to read/write

* [BEAM-9743] reverted header byte length check

* [BEAM-9743] fix typo

* [BEAM-9743] reflect comment : fix test + reformat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants