Skip to content

feat(admin-api): add manual GC job scheduling endpoint and ampctl command#2020

Open
mitchhs12 wants to merge 3 commits intomainfrom
mitchhs12/scheduler-wiring
Open

feat(admin-api): add manual GC job scheduling endpoint and ampctl command#2020
mitchhs12 wants to merge 3 commits intomainfrom
mitchhs12/scheduler-wiring

Conversation

@mitchhs12
Copy link
Contributor

@mitchhs12 mitchhs12 commented Mar 24, 2026

Summary

  • Adds POST /gc/schedule admin API endpoint that accepts a location_id and schedules a GC job for that physical table revision
  • Adds ampctl gc schedule <location_id> CLI command
  • Adds admin API client method client.gc().schedule(location_id)
  • Removes the automatic periodic scheduling (config, background task, dedup/throttle, scheduler tests) — periodic scheduling will be designed as a generic scheduler feature in a follow-up

Context

This is PR 3 of 3 splitting up the GC job extraction work:

  1. amp-worker-gc crate (merged in feat(amp-worker-gc): add standalone GC job crate #2009)
  2. Wire to worker service (merged in feat(worker): wire GC job type to worker and admin-api #2010)
  3. This PR — add manual trigger via admin API + ampctl

@mitchhs12 mitchhs12 requested a review from LNSD March 25, 2026 14:19
Copy link
Contributor

@LNSD LNSD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mitchhs12 mitchhs12 changed the title feat(controller): wire GC scheduling to controller feat(admin-api): add manual GC job scheduling endpoint and ampctl command Mar 25, 2026
@mitchhs12 mitchhs12 force-pushed the mitchhs12/scheduler-wiring branch from 4f6eff9 to 0893441 Compare March 25, 2026 17:49
…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.
@mitchhs12 mitchhs12 force-pushed the mitchhs12/scheduler-wiring branch from 0893441 to 40392d0 Compare March 25, 2026 18:18
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants