[ 
https://issues.apache.org/jira/browse/FLINK-40339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated FLINK-40339:
-----------------------------------
    Labels: pull-request-available  (was: )

> WatermarkCompactingSinkMaterializer reads MapState entries after removing them
> ------------------------------------------------------------------------------
>
>                 Key: FLINK-40339
>                 URL: https://issues.apache.org/jira/browse/FLINK-40339
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / API
>    Affects Versions: 2.3.0
>            Reporter: Gustavo de Morais
>            Assignee: Gustavo de Morais
>            Priority: Major
>              Labels: pull-request-available
>
> consolidateBufferToMinValue collects Map.Entry instances from the buffer 
> MapState, removes each one through the iterator, and only then calls 
> getValue() on them:
> {code:java}
> entries.add(iterator.next());
> iterator.remove();
> ...
> for (Map.Entry<Long, List<RowData>> entry : entries) {
> final List<RowData> values = entry.getValue(); {code}
> The value of a Map.Entry is undefined once the entry has been removed. The 
> heap backend happens to keep it readable, so this works by accident; a 
> backend that invalidates removed entries returns null and consolidation fails 
> with a NullPointerException on restore.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to