[ 
https://issues.apache.org/jira/browse/BEAM-8157?focusedWorklogId=317321&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-317321
 ]

ASF GitHub Bot logged work on BEAM-8157:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 24/Sep/19 10:04
            Start Date: 24/Sep/19 10:04
    Worklog Time Spent: 10m 
      Work Description: mxm commented on issue #9484: [BEAM-8157] Ensure key 
encoding for state requests is consistent across SDKs
URL: https://github.com/apache/beam/pull/9484#issuecomment-534488546
 
 
   >When the key encoding was changed prior to the Python SDK change, this PR 
was green, but my test failed. Are we missing (Flink runner) integration test 
coverage for state and timers for Python?
   
   I had assumed that the Python SDK would do nested encoding for the key in 
StateRequest, just like Java. Turns out, it did not. That was the reason why 
after removing the nested context for Java (first version of the PR), your 
tests failed because it would try removing the nested context from the Python 
encoded key, which was encoded using outer context.
   
   Now, the real problem is that the inconsistent key encoding is shadowed by 
Flink <=1.8 because it accepts keys for the state backend which do not belong 
to the partition key range. The Flink 1.9 (#9296) made it visible that the Java 
SDK was using the nested encoding, contrary to Python and the Runner itself, 
which were using the outer encoding. The reason the Python PVR tests in the 
Flink 1.9 PR were _not_ failing was that we are using parallelism 1, which I 
had advised against in the past (and I now have a better reason why). So we 
should increase the parallelism in a follow-up.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 317321)
    Time Spent: 5h 10m  (was: 5h)

> Key encoding for state requests is not consistent across SDKs
> -------------------------------------------------------------
>
>                 Key: BEAM-8157
>                 URL: https://issues.apache.org/jira/browse/BEAM-8157
>             Project: Beam
>          Issue Type: Bug
>          Components: runner-flink
>    Affects Versions: 2.13.0
>            Reporter: Maximilian Michels
>            Assignee: Maximilian Michels
>            Priority: Major
>             Fix For: 2.17.0
>
>          Time Spent: 5h 10m
>  Remaining Estimate: 0h
>
> The Flink runner requires the internal key to be encoded without a length 
> prefix (OUTER context). The user state request handler exposes a serialized 
> version of the key to the Runner. This key is encoded with the NESTED context 
> which may add a length prefix. We need to convert it to OUTER context to 
> match the Flink runner's key encoding.
> So far this has not caused the Flink Runner to behave incorrectly. However, 
> with the upcoming support for Flink 1.9, the state backend will not accept 
> requests for keys not part of any key group/partition of the operator. This 
> is very likely to happen with the encoding not being consistent.
> **NOTE** This is only applicable to the Java SDK, as the Python SDK uses 
> OUTER encoding for the key in state requests.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to