[
https://issues.apache.org/jira/browse/BEAM-8157?focusedWorklogId=308581&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-308581
]
ASF GitHub Bot logged work on BEAM-8157:
----------------------------------------
Author: ASF GitHub Bot
Created on: 09/Sep/19 02:43
Start Date: 09/Sep/19 02:43
Worklog Time Spent: 10m
Work Description: tweise commented on pull request #9484: [BEAM-8157]
Remove length prefix from state key for Flink's state backend
URL: https://github.com/apache/beam/pull/9484#discussion_r322048540
##########
File path:
runners/flink/src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/ExecutableStageDoFnOperator.java
##########
@@ -343,11 +345,10 @@ public void clear(K key, W window) {
}
private void prepareStateBackend(K key) {
- // Key for state request is shipped already encoded as ByteString,
- // this is mostly a wrapping with ByteBuffer. We still follow the
- // usual key encoding procedure.
- // final ByteBuffer encodedKey = FlinkKeyUtils.encodeKey(key,
keyCoder);
- final ByteBuffer encodedKey = ByteBuffer.wrap(key.toByteArray());
+ // Key for state request is shipped encoded. It may be encoded with
NESTED context which
Review comment:
Don't we need to know for sure it was encoded as NESTED to perform such
re-encoding? FWIW the test fails because of the attempt to decode a non-nested
(not length prefixed key). ` [107, 49]`
----------------------------------------------------------------
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: 308581)
Time Spent: 3h 20m (was: 3h 10m)
> [Flink Runner 1.9] State requests return wrong state in timers when encoded
> key is length-prefixed
> --------------------------------------------------------------------------------------------------
>
> 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.16.0
>
> Time Spent: 3h 20m
> 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.
--
This message was sent by Atlassian Jira
(v8.3.2#803003)