Hello, I was experimenting with the upgrade modes...
# troubleshooting
s
Hello, I was experimenting with the upgrade modes supported by flink operator. Need some inputs. As per docs, 1. last-state: Quick upgrades in any application state (even for failing jobs), does not require a healthy job as it always uses the latest checkpoint information. Manual recovery may be necessary if HA metadata is lost. 2. savepoint: Use savepoint for upgrade, providing maximal safety and possibility to serve as backup/fork point. The savepoint will be created during the upgrade process. Note that the Flink job needs to be running to allow the savepoint to get created. If the job is in an unhealthy state, the last checkpoint will be used (unless
kubernetes.operator.job.upgrade.last-state-fallback.enabled
is set to
false
). If the last checkpoint is not available, the job upgrade will fail. So is it always better to use savepoint as it falls back last state mode in case when job is unhealthy.? In savepoint upgrade , always savepoint is taken before upgrade/restart. Can it increase job estarting time? Which one is preferred for a statefull stream processing flink job?
s
last-state
is usually faster, especially if you have a lot of state. I use that as a default and only leverage
savepoint
for migrations.
👍 1
s
when we are upgrading jobs, how does “last state” upgrade gracefully recover without affecting state? So it just restarts from last successful checkpoint available? When deploying a job manually (without flink operator), we would just take savepoint before upgrading a job and restart with the savepoint taken. How the same process is followed with “last-state” upgrade mode
s
So it just restart from last successful checkpoint available?
Yep, exactly. So you're potentially losing some of the state updates or emitting duplicates. But if the job is deterministic it shouldn't matter.
👍 1
s
thanks for your inputs
g
The last-state upgrade is very similiar to a regular failover scenario. When the job fails Flink restores it from the latest state. It’s like we induce a failure and swap (upgrade) the job before flink restarts it 🙂
👍 3
s
Cool. So savepoint upgrade mode seems to be a better option for graceful upgrades or restarts.