You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by lec ssmi <sh...@gmail.com> on 2020/06/02 14:23:24 UTC

The trigger of State TTL

    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!

Re: The trigger of State TTL

Posted by Andrey Zagrebin <az...@apache.org>.
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

[1]
https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/stream/state/state.html#incremental-cleanup
[2]
https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/stream/state/state.html#cleanup-during-rocksdb-compaction

On Tue, Jun 2, 2020 at 5:23 PM lec ssmi <sh...@gmail.com> 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!
>
>