Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
1.9.0, 1.10.0
-
None
-
None
Description
At the moment, there are 2 ways to cleanup states.
1) registering a processing-time timer, and cleanup entries when the timer is callback.
- pros: can cleanup multiple states at the same time (state consistent)
- cons: timer space depends on the key size, which may lead to OOM (heap timer).
- used in Group Aggregation, Over Aggregation, TopN
2) using the StateTtlConfig provided by DataStream [1].
- pros: decouple the logic of state ttl with the record processing, easy to program (take a look at old planner NonWindowJoin which bundles ttl timestamp with records in MapState).
- cons: can't cleanup multiple states at the same time.
- useed in Sream-Stream Joins.
For timer solution, although it can cleanup multiple states at the same time, but it also will lead to OOM when there have a great many state keys, besides, StateTtlConfig is used in stream-stream join case, and will be used in more operator. Therefore,in order to unify the state ttl solution, simplify the code implemention, and improve the readability of codes, so we should refactor state cleanup way which use StateTtlConfig to replace processing-time timer in Group Aggregation、Deduplication、TopN operators.
Attachments
Issue Links
- is duplicated by
-
FLINK-17096 Mini-batch group aggregation doesn't expire state even if state ttl is enabled
- Closed