(Question about kubernetes operator) Yesterday our...
# troubleshooting
a
(Question about kubernetes operator) Yesterday our job fell into a bad state where Taskmanagers were crashing from OOM. We attempted to trigger an upgrade scenario. Since the job was failing, a new savepoint could not be taken, so last-state was supposed to be used. Logs from the operator confirm this:
Copy code
2024-02-15 19:38:38,252 o.a.f.k.o.l.AuditUtils         [INFO ][job-name] >>> Event  | Info    | SPECCHANGED     | UPGRADE change(s) detected (Diff: FlinkDeploymentSpec[image : image:0a7c41b -> image:ebebc53, restartNonce : null -> 100]), starting reconciliation.
2024-02-15 19:38:38,252 o.a.f.k.o.r.d.AbstractJobReconciler [INFO ][job-name] Upgrading/Restarting running job, suspending first...
2024-02-15 19:38:38,260 o.a.f.k.o.r.d.ApplicationReconciler [INFO ][job-name] Job is not running but HA metadata is available for last state restore, ready for upgrade
2024-02-15 19:38:38,270 o.a.f.k.o.l.AuditUtils         [INFO ][job-name] >>> Event  | Info    | SUSPENDED       | Suspending existing deployment.
2024-02-15 19:38:38,270 o.a.f.k.o.s.NativeFlinkService [INFO ][job-name] Deleting JobManager deployment while preserving HA metadata.	
2024-02-15 19:38:40,431 o.a.f.k.o.l.AuditUtils         [INFO ][job-name] >>> Status | Info    | UPGRADING       | The resource is being upgraded 
2024-02-15 19:38:40,532 o.a.f.k.o.l.AuditUtils         [INFO ][job-name] >>> Event  | Info    | SUBMIT          | Starting deployment
2024-02-15 19:38:40,532 o.a.f.k.o.s.AbstractFlinkService [INFO ][job-name] Deploying application cluster requiring last-state from HA metadata
2024-02-15 19:38:40,538 o.a.f.k.o.u.FlinkUtils         [INFO ][job-name] Job graph in ConfigMap job-name-cluster-config-map is deleted
However, instead of using the last checkpoint taken, it used the last savepoint taken, which was 6 days old, putting our streams erroneously back 6 days! Log example from the job pods:
Copy code
2024-02-15 19:39:03,887 INFO  org.apache.flink.runtime.checkpoint.CheckpointCoordinator    [] - Restoring job 522b3c363499d81ed7922aa30b13e237 from Savepoint 20207 @ 0 for 522b3c363499d81ed7922aa30b13e237 located at abfss://savepoints@storageaccount.dfs.core.windows.net/job-name/savepoint-522b3c-8836a1edc709.
Any reason why it used the last savepoint rather than the last checkpoint? I was under the impression if upgradeMode: savepoint fell back to last-state, it would use the last checkpoint.
g
Please open a jira ticket with the details. It could be that somehow the HA metadata got deleted between submission and recovery?
But in general this should not happen, and I don鈥檛 really understand whats going on here 馃槙
Or could it be that you upgraded Flink version during the upgrade?
a
I'll check to see if the flink version was changed during this
Unfortunately no, the last version change was weeks ago
@Gyula F贸ra I'm able to recreate the issue in a test setting. I'll file the issue. I think it is an edge case - if the behavior is indeed expected, the Operator logs aren't saying what the job is actually doing
Filed here, thanks for the response! https://issues.apache.org/jira/browse/FLINK-34451
g
I see you are using operator 1.6.1 , it would be good to test if the issue affects the latest 1.7.0 version (or 1.8-SNAPSHOT) as well
Also does this affect specifically the adaptive scheduler? Or default scheduler is also broken . And also older Flink version (1.17)
If we have the answers to these, then it鈥檚 going to be much easier to fix
lets continue on jira 馃檪
a
@Gyula F贸ra I just ran into a similar issue where a failed job restored from the last savepoint that was taken on a job upgrade rather than using the last savepoint that was taken on a PERIODIC basis, setting the job back weeks. Could the issue I pointed out above have caused that, too? The version that that occurred on was 1.18 (but I upgraded to 1.19 this morning!)
g
Depends on the exact Flink version and if it contains the fix for the issue @Alex Craig :)
a
@Gyula F贸ra Suppose the version doesn't have the fix for that issue. Do those symptoms sound similar to the other issue? Mostly wondering if losing the HA metadata would cause the job to lose track of the periodic savepoints it made over the course of its runtime
Just wondering why it restored from the last UPGRADE savepoint and it didn't use the last PERIODIC savepoint, even though the deployment had stored the lastSavepoint information properly as the PERIODIC one