The trigger of State TTL

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The trigger of State TTL

lec ssmi
    As we known, flink can set certain TTL config for the state, so that the state can be  automatically cleared after being idle for a period of time.
But if there is no new record coming in after setting  the TTL config , will the state be automatically cleared after a certain time? Or does it require a new  record  to trigger this clear operation ? 
 
Thanks! 

Reply | Threaded
Open this post in threaded view
|

Re: The trigger of State TTL

Andrey Zagrebin-5
Hi Lec Ssmi,

It depends on the state backend you use.
The heap state backend needs that either some state access happens or some records get processed in the operator [1].
The RocksDB requires that the state size is big enough (roughly speaking) to trigger the compaction process to clean the expired state [2].
Please, see the notes in the user documentation chapters referred by the suggested links.

Best,
Andrey


On Tue, Jun 2, 2020 at 5:23 PM lec ssmi <[hidden email]> wrote:
    As we known, flink can set certain TTL config for the state, so that the state can be  automatically cleared after being idle for a period of time.
But if there is no new record coming in after setting  the TTL config , will the state be automatically cleared after a certain time? Or does it require a new  record  to trigger this clear operation ? 
 
Thanks!