[ 
https://issues.apache.org/jira/browse/FLINK-9269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16458031#comment-16458031
 ] 

ASF GitHub Bot commented on FLINK-9269:
---------------------------------------

Github user sihuazhou commented on the issue:

    https://github.com/apache/flink/pull/5934
  
    Hi @StefanRRichter , I think I feel lost again... when I writing the 
comments for the serializer about why we don't duplicate it, I found a loophole 
there. In theory, even tough the serializer is just written, but if the 
serializer is stateful (e.g. it maintain a `variable` inside, and do the 
serializing works according to it and also may update the `variable` according 
to the serialized result) then it might also lead to concurrency problem if we 
don't duplicate it. But in practice, I can't find any use cases that need a 
stateful serializer as far as I can see... So, now I feel lost in duplicating 
it to be on the safer side in theory or just add some comments without 
duplicate it to avoid the costs of the duplicating. What do you think?


> Concurrency problem in HeapKeyedStateBackend when performing checkpoint async
> -----------------------------------------------------------------------------
>
>                 Key: FLINK-9269
>                 URL: https://issues.apache.org/jira/browse/FLINK-9269
>             Project: Flink
>          Issue Type: Bug
>          Components: State Backends, Checkpointing
>    Affects Versions: 1.5.0
>            Reporter: Sihua Zhou
>            Assignee: Sihua Zhou
>            Priority: Blocker
>             Fix For: 1.5.0
>
>
> {code:java}
> @Nonnull
> @Override
> protected SnapshotResult<KeyedStateHandle> performOperation() throws 
> Exception {
>     // do something
>    long[] keyGroupRangeOffsets = new 
> long[keyGroupRange.getNumberOfKeyGroups()];
>    for (int keyGroupPos = 0; keyGroupPos < 
> keyGroupRange.getNumberOfKeyGroups(); ++keyGroupPos) {
>       int keyGroupId = keyGroupRange.getKeyGroupId(keyGroupPos);
>       keyGroupRangeOffsets[keyGroupPos] = localStream.getPos();
>       outView.writeInt(keyGroupId);
>       for (Map.Entry<String, StateTable<K, ?, ?>> kvState : 
> stateTables.entrySet()) {
>         // do something
>       }
>     }
>     // do something
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to