-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Backend] Cache - Update max_cache_staleness logic #3451
Conversation
This commit adds initial execution cache service. Including http service and execution key generation.
…ax_cache_staleness
…ax_cache_staleness
…ax_cache_staleness
/assign @Ark-kun |
/lgtm |
@Ark-kun will leave approval to you. |
Hmm. Initially I had the impression that the code logic in this PR was different from the stated logic. However, now I see that the logic was later revised and now it looks correct. I'd like to add some tests to verify the logic before checking this PR in though. |
kindly ping. Alexy, will you continue this PR? Assume it won't block 0.5.1 release. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
(sorry, miss clicked close) |
@@ -76,7 +77,7 @@ func (s *ExecutionCacheStore) scanRows(rows *sql.Rows, podMaxCacheStaleness int6 | |||
} | |||
log.Println("Get id: " + strconv.FormatInt(id, 10)) | |||
log.Println("Get template: " + executionTemplate) | |||
if maxCacheStaleness == -1 || s.time.Now().UTC().Unix()-startedAtInSec <= podMaxCacheStaleness { | |||
if maxCacheStaleness == -1 || s.time.Now().UTC().Unix()-startedAtInSec <= maxCacheStaleness { |
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 think the check needs to be
if maxCacheStaleness == -1 || s.time.Now().UTC().Unix()-startedAtInSec <= maxCacheStaleness { | |
if podMaxCacheStaleness == -1 || s.time.Now().UTC().Unix()-startedAtInSec <= podMaxCacheStaleness { |
(with podMaxCacheStaleness
parameter added back to the function).
The task cannot/should not control whether its data can be reused in the future. It can only control whether it can be skipped.
So, when we do lookup, we only care about the preferences of the current pod/task.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had recent activity. Please comment "/reopen" to reopen it. |
This PR updates max_cache_staleness logic to:
(1) if cache_entry is too old for target pod, ignore
(2) if pod.maxCacheStaleness != -1, return latest cache_entry with entry.maxCacheStaleness == pod.maxCacheStaleness
(3) return overall latest cache_entry if pod.maxCacheStaleness == -1
Part of #2904