-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-35493][snapshot] Add historical cleanup for FlinkStateSnapshot CRs #860
Conversation
@anupamaggarwal @gyfora @ferenc-csaky We need this PR to be able to automatically clean up FlinkStateSnapshot resources created by the operator.
I also created new configs for checkpoints, because I felt like users might want to use different cleanup policies for checkpoints than savepoints. |
aae2d78
to
02e6f82
Compare
...s-operator/src/main/java/org/apache/flink/kubernetes/operator/observer/SnapshotObserver.java
Outdated
Show resolved
Hide resolved
Just for clarification, if the snapshot resource is not installed / enabled, will the old cleanup mechanism still work in the legacy mode? |
02e6f82
to
f06f6b6
Compare
I forgot to add a check when setting up informer event sources, the latest commit should take care of that. I have manually checked and the cleanup is still working the same way it has been if CRD is not installed. |
After talking with @gyfora I have made it so legacy savepoints will be cleaned up even if FlinkStateSnapshot is enabled for the job. This will use the number of completed FlinkStateSnapshot CRs and subtract that from the I have also changed the logic a bit so we extract When this PR gets merged, I will also update #862 to test cleaning up legacy savepoints with FlinkStateSnapshot enabled. |
7146cea
to
c6ea09b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if I missed something but seems to me that in the new cleanup logic we can easily end up In situations where all snapshots are deleted which would be good to avoid
Brief change log
Verifying this change
Does this pull request potentially affect one of the following parts:
CustomResourceDescriptors
: noDocumentation