Add "table repacker" maintenance services that runs REPACK (CONCURRENTLY)#1228
Draft
Add "table repacker" maintenance services that runs REPACK (CONCURRENTLY)#1228
REPACK (CONCURRENTLY)#1228Conversation
…NTLY)` Here, add a maintenance service modeled on the reindexer that runs `REPACK (CONCURRENTLY)`, a new feature slated for Postgres 19 [1]. This is an exciting new feature that can fully reset a table without needing to take an exclusive lock the way that `VACUUM FULL` does. This feature may be on the riskier side at first, so I've disabled it by default, requiring an explicit `RepackerEnabled: true` to activate. Similar to the reindexer it runs once a day. I've staggered its start time to 1 AM UTC so it's offset from the reindexer's start time of midnight. This relies on Postgres 19 to work, so it's not really suitable for release yet, but I've put in fallback code that causes it to run `VACUUM FULL` for Postgres prior to 19. (This is obviously not suitable for use, but it gets the test matrix running.) [1] postgres/postgres@28d534e
brandur
added a commit
that referenced
this pull request
Apr 25, 2026
I just noticed while putting together #1228 that we have an unused constant in the reindexer, `ReindexerIntervalDefault`, as some time back the interval was replaced by a schedule func. Here, drop it.
Contributor
Author
|
Actually, two addendums upon further thought:
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Here, add a maintenance service modeled on the reindexer that runs
REPACK (CONCURRENTLY), a new feature slated for Postgres 19 [1]. Thisis an exciting new feature that can fully reset a table without needing
to take an exclusive lock the way that
VACUUM FULLdoes.This feature may be on the riskier side at first, so I've disabled it by
default, requiring an explicit
RepackerEnabled: trueto activate.Similar to the reindexer it runs once a day. I've staggered its start
time to 1 AM UTC so it's offset from the reindexer's start time of
midnight.
This relies on Postgres 19 to work, so it's not really suitable for
release yet, but I've put in fallback code that causes it to run
VACUUM FULLfor Postgres prior to 19. (This is obviously not suitable for use,but it gets the test matrix running.)
[1] postgres/postgres@28d534e