feat(admin-api): add manual GC job scheduling endpoint and ampctl command#2020
Open
feat(admin-api): add manual GC job scheduling endpoint and ampctl command#2020
Conversation
LNSD
requested changes
Mar 25, 2026
Contributor
LNSD
left a comment
There was a problem hiding this comment.
As a first step, I would simplify the current PR and require a manual GC job trigger.
We need to discuss the scheduler periodic trigger design in a separate piece of work.
LNSD
reviewed
Mar 25, 2026
4f6eff9 to
0893441
Compare
…mand Replace automatic periodic GC scheduling with a manual trigger. Add POST /gc/schedule endpoint to the admin API that accepts a location_id and schedules a GC job for that physical table revision. Add corresponding `ampctl gc schedule <location_id>` command and admin client method. The automatic scheduling loop, config, dedup/throttle logic, and scheduler tests are removed. Periodic scheduling will be designed as a generic scheduler feature in a follow-up.
0893441 to
40392d0
Compare
Move main functions and error types before helper types per docs/code/rust-modules-members.md ordering convention.
Change POST /gc/schedule (JSON body) to POST /gc/{location_id}/schedule
(path parameter) to follow the existing /{resource}/{id}/{action} REST
convention used by /jobs/{id}/stop, /revisions/{id}/restore, etc.
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.
Summary
POST /gc/scheduleadmin API endpoint that accepts alocation_idand schedules a GC job for that physical table revisionampctl gc schedule <location_id>CLI commandclient.gc().schedule(location_id)Context
This is PR 3 of 3 splitting up the GC job extraction work:
amp-worker-gccrate (merged in feat(amp-worker-gc): add standalone GC job crate #2009)Wire to worker service (merged in feat(worker): wire GC job type to worker and admin-api #2010)