Details
-
Improvement
-
Status: Open
-
Not a Priority
-
Resolution: Unresolved
-
None
-
None
Description
See: FLINK-11774
Description:
The hashCode implementation of Enum-Values is guaranteed to be stable inside a JVM, but not accross multiple JVMs. This leads to failures when restoring from a checkpoint/savepoint containing Keyed-State on Keys with Enums as a part of the key.
For users of Flink there is a workaround to solve this problem:
Don't rely on the hashCode-Implementation of Enum-Values in the hashCode-Implementation of the actual key. Use the ordinal() or name().hashCode() instead of the Enum hashCode.
Goals of this improvement:
Implement a way to handle Enum-Values, by either handling Enum-Values on a internal level or implementing a abstract Base KeySelector class that users of flink can choose if their key contains a Enum-Value.
Code to reproduce a failure and first thoughts can be found in FLINK-11774 .
Attachments
Issue Links
- is caused by
-
FLINK-11774 Unstable hashCode causes IllegalArgumentException in HeapPriorityQueueSet
- Resolved
- is related to
-
FLINK-16555 Preflight check for known unstable hashCodes.
- Closed
- relates to
-
FLINK-5875 Use TypeComparator.hash() instead of Object.hashCode() for keying in DataStream API
- Open