-
Notifications
You must be signed in to change notification settings - Fork 4.4k
[BEAM-8271] Properly encode/decode StateGetRequest/Response continuation token #10595
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-8271] Properly encode/decode StateGetRequest/Response continuation token #10595
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think it's more correct to let continuation_token by bytes everywhere (possibly fixing the uses if need be).
Here's the ticket I made: https://issues.apache.org/jira/browse/BEAM-8271. It's been awhile, but my instinct was that this is an issue in the proto file: all other id-like fields throughout these protos are strings. Also, the token itself is created using string operations ( IIRC, my first attempt to solve this was to preserve the If I haven't convinced you yet, I can show you what an alternate solution looks like using bytes, but first please do have a look at other ids in the .proto files and at the Java equivalent for this. |
It's bytes because non-trivial runners may serialize arbitrary data into this field used to continue the iterable. (Ids are strings because they're just used to compare against, and also the type of proto map keys constrains us here.) There shouldn't be any manipulation of this token except for passing it back on the client side at least--just accepting it and passing it back. It looks like Java treats this as a BytesString. I still think we should do the same. |
Ok, I’ll have another look at it.
…On Wed, Jan 29, 2020 at 5:06 PM Robert Bradshaw ***@***.***> wrote:
It's bytes because non-trivial runners may serialize arbitrary data into
this field used to continue the iterable. (Ids are strings because they're
just used to compare against, and also the type of proto map keys
constrains us here.) There shouldn't be any manipulation of this token
except for passing it back on the client side at least--just accepting it
and passing it back.
It looks like Java treats this as a BytesString. I still think we should
do the same.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#10595?email_source=notifications&email_token=AAAPOEZIZDOZV2R57LDTC53RAIRYFA5CNFSM4KG3STR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKJKUMQ#issuecomment-580037170>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAPOEZ5IKZ6MDLBMGXJIYDRAIRYFANCNFSM4KG3STRQ>
.
|
315e41c
to
590bc03
Compare
@robertwb Ok, the solution using Note: I can't see the tests on this PR. Are they running? |
Make sense. Thanks for the explanation. |
…ion_token Ensure proper handling of bytes vs unicode
590bc03
to
e15d33f
Compare
@robertwb this is ready to go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. LGTM, pending merge conflict resolution.
This behavior is the same as Java, and corrects an inconsistency with bytes/str that might have caused problems in python3.
This is a followup to #9056.
Note that this issue has its own Jira.
R: @robertwb
R: @udim
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username
).[BEAM-XXX] Fixes bug in ApproximateQuantiles
, where you replaceBEAM-XXX
with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.See the Contributor Guide for more tips on how to make review process smoother.
Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.