-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(coderd/database/dbpurge): add retention for connection logs #21022
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
Merged
Conversation
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
c067a63 to
661866d
Compare
b8a4bdb to
0fb3b51
Compare
This was referenced Dec 1, 2025
724b589 to
782f1f7
Compare
ethanndickson
approved these changes
Dec 2, 2025
Member
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.
nice! I'm glad we're doing this.
b34ee61 to
d5062e2
Compare
782f1f7 to
039afdb
Compare
Base automatically changed from
mafredri/feat-coderd-db-retention-policy
to
main
December 2, 2025 14:04
Connection logs retention is now explicit - it's enabled when --connection-logs-retention is set to a non-zero duration, and disabled when set to 0. No fallback to global retention.
Use :execrows instead of :one to simplify the query by removing the extra CTE wrapper. This lets PostgreSQL return the row count directly via RowsAffected() instead of requiring an explicit COUNT(*) scan.
Increase from 1000 to 10000 to improve deletion throughput for large deployments. At 10 minute intervals, this allows purging up to 1.44M records per day.
6433def to
d456497
Compare
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.
Add
DeleteOldConnectionLogsquery and integrate it into thedbpurgeroutine. Retention is controlled by
--retention-connection-logsflag.Disabled (0) by default.
Depends on #21021
Updates #20743
PR Stack
workspace_agent_logs