feat(testbedctl): add gc-regions and purge commands - #3
Merged
Conversation
- `testbedctl gc-regions <id>... [--full]` runs `admin gc_regions(...)`, mirroring the table-level `gc` command but for specific region IDs (u64, e.g. from greptimedb logs). --full/-f forces a full object-storage file listing. Region IDs must be numeric. - `testbedctl purge <table> [-y]` runs `admin purge_table(...)`, permanently purging a DROPPED table's data. It prompts for confirmation by default (irreversible); -y/--yes skips it. Both are documented in AGENTS.md and README.md alongside flush/compact/gc.
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
Adds two more
testbedctladmin commands alongside the existingflush/compact/gc, both running against the client PostgreSQL port (11043), so they work identically in distributed (haproxy),standalone,standalone-fs, and active/standby modes.gc-regions— region-scoped GCMirrors the table-level
gccommand but targets specific region IDs (u64 values, e.g. from greptimedb logs).--full/-fforces a full object-storage file listing. Region IDs must be numeric (rejected otherwise).purge— permanently purge a dropped tableRuns
admin purge_table(...), which permanently removes a dropped table's data (irreversible). Prompts for confirmation by default;-y/--yesskips it for scripting.Notes
flush/compact/gc, these route through the frontend to the metasrv leader (check_leader).gc-regions/purgeare synchronous within the GC/proceduremailbox_timeout(default 60s).AGENTS.mdandREADME.md.Verification
bash -n testbedctlpasses.psql): region IDs joined as numbers,--fullappends the trailing boolean.purgeconfirmation flow:naborts (exit 1),yproceeds;-ybypasses; no-arg prints usage.gc-regionsrejects non-numeric IDs and prints usage with no args.testbedctl helpand both docs show the new commands.