Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
238 views
in Technique[技术] by (71.8m points)

apache flink - Evolving TTL On The Roadmap?

Flink version 1.8 introduced the support for evolving state schema. My question is will Flink introduce support of evolving time to live (TTL) to state. Right now you can't add TTL to an existing state not configured with TTL and expect to be able to restore state. I'm curious if Flink intends to open this possibility up in the future? The only work around I see might now is to enable TTL on all my state and then just set the expiration so something unbelievable high which gives me the flexibility to use the TTL features later down the line if I am still interested in it. Of course with a expiration that is based on meaningful business logic and not just some extremely high number.

Time To Live Source: https://ci.apache.org/projects/flink/flink-docs-stable/dev/stream/state/state.html#state-time-to-live-ttl

Evolving State Schema Source: https://ci.apache.org/projects/flink/flink-docs-stable/dev/stream/state/schema_evolution.html

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I can't recall any discussion of this on the mailing lists, nor can I find any JIRA tickets on this topic.

The workaround you've proposed isn't ideal, because you will pay the cost for state TTL (both the space for the timers and the processing effort of checking for expired state), with little benefit.

What you might do instead is to use the State Processor API to migrate your data to new state descriptors. You would use the existing state descriptor to read the data from a state snapshot (savepoint or checkpoint), and then use an updated state descriptor to write the state out to a new savepoint.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...