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

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

> Heap state backend savepoint fails with NPE when MapState contains null values
> ------------------------------------------------------------------------------
>
>                 Key: FLINK-39909
>                 URL: https://issues.apache.org/jira/browse/FLINK-39909
>             Project: Flink
>          Issue Type: Bug
>          Components: Runtime / Checkpointing, Runtime / State Backends
>            Reporter: Mukul Gupta
>            Priority: Major
>              Labels: pull-request-available
>
> Found while investigating FLINK-38144.
> HeapKeyValueStateIterator unconditionally calls 
> userValueSerializer.serialize(userValue, valueOut) after writing thenull 
> flag, causing NPE during canonical savepoint when MapState contains null 
> values with null-unsafe serializers (IntSerializer, LongSerializer, 
> BooleanSerializer, etc.).
> Code path:
> https://github.com/apache/flink/blob/master/flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/HeapKeyValueStateIterator.java#365
> Same asymmetric pattern fixed for RocksDB/ForSt in FLINK-38137. Only affects 
> canonical savepoints — heap checkpoints use MapSerializer.serialize() which 
> handles nulls internally.
> Fix: skip serializer call when value is null (matching the deserialization 
> side which already checks the null flag).



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

Reply via email to