Hi Team , i have set of stateless flink applicatio...
# troubleshooting
a
Hi Team , i have set of stateless flink application which are currently running with upgradeMode: last-state. Am thinking about changing the upgradeMode to stateless. But looking at the documentation (https://nightlies.apache.org/flink/flink-kubernetes-operator-docs-main/docs/custom-resource/job-management/#stateful-and-state[…]pplication-upgrades) its says not good for production use . Can someone explain why is that ? if we use upgradeMode stateless for a stateless flink app , any other issues or scenarios can happen? is that the reason its not recommended as "not for production use"? Thanks in Advance
g
Most prod applications are stateful therefore the stateless upgrade mode which discards the state is dangerous
🎯 1
But if your job is stateless you should simply use stateless upgrade mode in prod
Absolutely no problem there you won’t lose out on any feature :)
a
Thanks @Gyula Fóra
m
Sorry, 1 additional question to your tread @Abhilash S.R. Could you please specify - by state you mean only state from Flink context shared between operators or checkpoints also considered as a state? I mean if you restore your job from last checkpoint it will still work with ‘stateless’ upgrade mode?
a
state from Flink context shared between operators
🎯 1
"if you restore your job from last checkpoint it will still work with ‘stateless’ upgrade " . yes it should work as @Gyula Fóra mentioned all other features should work as it is
👍 1
@Gyula Fóra just to double confirm on the same point wrt to checkpoint . upgrade mode : stateless then does the application honor checkpoint and lets say when the next deployment happens will the application goes back to the earliest kafka message ? or it will be from the last committed offset .
g
It depends on your app config, with stateless the app starts from completely empty state as if the first time
No magic involved :)
You can set your start offsets in the Kafka connector
If you set earliest there, then starless will start from earliest
a
when you say It depends on your app config , the default config for flink kafka surce operator is to read data from last commited offset right . So lets say my app was in stateless and i do enable checkpoint during next deployment it should ideally start from the last commited offset right ?
g
Yes
a
perfect so app wont simply go back to my earlier offeset and read all the duplicate data during each deployments 🙂 that was my concern with upgrade mode : stateless
g
Please test it and make sure you understand , the behavior is very well defined
Depending on your settings it will either do what you want or it doesn’t
Test it
a
sure thanks
🚢 1