Repository navigation
feat: purge expired api keys in dbpurge - #20863
Merged
Merged
Conversation
Emyrk
commented
Nov 21, 2025
Comment on lines
+89
to
+90
| // TODO: Arbitrary numbers are arbitrary... | ||
| LimitCount: 10000, |
Member
Author
There was a problem hiding this comment.
We know an api_key migration takes so long it can timeout.
I don't like arbitrary numbers, but if this table is massive, we should spread the load out. DB purge runs every 10 minutes. 10k feels large, but not insane to be too slow?
Comment on lines
+82
to
+86
| // Leave expired keys for a week to allow the backend to know the difference | ||
| // between a 404 and an expired key. This purge code is just to bound the size of | ||
| // the table to something more reasonable. | ||
| // TODO: Does this matter? | ||
| Before: dbtime.Time(start.Add(time.Hour * 24 * 7 * -1)), |
Member
Author
There was a problem hiding this comment.
There is a behavior change if we purge expired keys. And I wonder if the difference between 404 & expired is good information.
Member
Author
|
We are good. The oauth token is also deleted from the |
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Emyrk
force-pushed
the
stevenmasley/purge_expired_keys
branch
from
November 21, 2025 16:29
ceb15c5 to
11bf986
Compare
Emyrk
marked this pull request as ready for review
November 21, 2025 16:35
Emyrk
force-pushed
the
stevenmasley/purge_expired_keys
branch
from
November 21, 2025 17:55
0cd1c02 to
43290cd
Compare
dannykopping
approved these changes
Nov 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

closes #19889
This is in response to a migration in v2.27 that takes very long on deployments with large
api_keytables.