Is there a way we can determine, if flink job got ...
# troubleshooting
s
Is there a way we can determine, if flink job got restarted inside ProcessFunction without add explicit flags in state?
d
If it was restarted due to an error, you can check the Flink job failure root cause exception and look for the stack trace.
s
I have it running in the K8ns, pod goes down, then I wouldn’t have logs when new pod comes back up and flink job is restarted. Is there anywhere from state of from Flink API, I would know that job was restarted.
d
Does the Flink JM pod go down too?
s
sometimes
during maintenance
d
You can try to get logs from previous k8s container assuming this is just a container restart and you are logging to stdout:
kubectl -n <your-namespace> logs <your-pod> -p
^ or in the Flink dashboard
s
but I want this information in the processfunction, so can’t get from logs. Basically, I need to know when if job got restarted mid window, if yes, I want to discard that data.
d
You should not need to worry about that, assuming you are using Flink state. When a Flink job fails over the subtasks and state will be restarted from the latest checkpoint, state will be rewound accordingly.
s
I thought so too. In my case, with Processing Time(can’t use eventTime), when job restarts, the window when job was going down has incomplete data, I want to ignore that and the next window after that. I tried have variables in state but those I am unable to clear during checkpoint failures. 😞
BTW thanks for discussing options.
d
What happens when you generally fall behind and process a backlog, is this ok? If you are only concerned about the fresh data maybe you do not need checkpoints?
➕ 1
s
Right, I think, I do not need checkpoint. I will try that and see. Thank you @Danny Cranmer