Open
Conversation
shiyasmohd
requested changes
Mar 7, 2026
Contributor
shiyasmohd
left a comment
There was a problem hiding this comment.
Added some suggestions as comments, Major blockers are
- Confirm revision is inactive before pruning
- Add integration tests in
it_admin_api_revisions.rs
Schedule non-canonical segments for garbage collection instead of immediate
deletion, providing a configurable safety window before files are removed.
- Add `DELETE /revisions/{id}/prune` endpoint with `before_block` and
`gc_delay_secs` query parameters
- Implement canonical chain computation to identify non-canonical segments
- Schedule files via `gc_manifest` table for deferred deletion by collector
- Add `ampctl table prune` CLI with human-readable `--gc-delay` duration
- Require writer job to be terminal before pruning (same safety as truncate)
7f37ac0 to
648ac5c
Compare
shiyasmohd
approved these changes
Mar 9, 2026
Contributor
shiyasmohd
left a comment
There was a problem hiding this comment.
I would also add a test case where there are non canonical segments.
test case would look like
- mine 10 blocks
- deploy with end block 10
- reorg 3 block and mine blocks
- deploy with end block 13
and checkfiles_scheduled > 0
LNSD
requested changes
Mar 9, 2026
Contributor
LNSD
left a comment
There was a problem hiding this comment.
Please, check my comments 🙂
| gc_duration, | ||
| ) | ||
| .await | ||
| .map_err(Error::ScheduleGc)?; |
Contributor
There was a problem hiding this comment.
I think we should centralize the GC APIs in the DataStore. For example, add a "mark for deletion" method.
Adding metadata DB manipulation functions in the Admin API handlers is a design flaw that we need to address.
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.
Schedule non-canonical segments for garbage collection instead of immediate deletion, providing a configurable safety window before files are removed.
DELETE /revisions/{id}/pruneendpoint withbefore_blockandgc_delay_secsquery parametersgc_manifesttable for deferred deletion by collectorampctl table pruneCLI