-
Notifications
You must be signed in to change notification settings - Fork 415
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-36110][snapshot] Store periodic snapshot trigger timestamps in memory #868
Conversation
f7d4ce4
to
4811b19
Compare
...va/org/apache/flink/kubernetes/operator/reconciler/deployment/ApplicationReconcilerTest.java
Show resolved
Hide resolved
4811b19
to
ad1b33e
Compare
ad1b33e
to
2d7bf56
Compare
...main/java/org/apache/flink/kubernetes/operator/reconciler/SnapshotTriggerTimestampStore.java
Outdated
Show resolved
Hide resolved
...n/java/org/apache/flink/kubernetes/operator/reconciler/deployment/AbstractJobReconciler.java
Outdated
Show resolved
Hide resolved
...n/java/org/apache/flink/kubernetes/operator/reconciler/deployment/AbstractJobReconciler.java
Outdated
Show resolved
Hide resolved
…ng to PR comments
.orElseGet( | ||
() -> { | ||
var legacyTs = getLegacyTimestamp(resource, snapshotType); | ||
var creationTs = | ||
Instant.parse(resource.getMetadata().getCreationTimestamp()); | ||
|
||
if (legacyTs.compareTo(creationTs) > 0) { | ||
return legacyTs; | ||
} else { | ||
return creationTs; | ||
} | ||
}); |
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.
Should we put into the cache before returning?
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.
I like this idea, with this change we won't unnecessarily call the supplier if we don't trigger a periodic snapshot in AbstractJobReconciler.
What is the purpose of the change
SnapshotObserver uses deprecated fields as the latest timestamp of triggered snapshots. These fields are not updated when using FlinkStateSnapshot though. This new method of storing these timestamps is meant to fix this case.
Brief change log
Verifying this change
Does this pull request potentially affect one of the following parts:
CustomResourceDescriptors
: noDocumentation