Skip to content

feat(testbedctl): add compact command - #2

Merged
sunng87 merged 1 commit into
mainfrom
feat/testbedctl-compact
Jul 23, 2026
Merged

feat(testbedctl): add compact command#2
sunng87 merged 1 commit into
mainfrom
feat/testbedctl-compact

Conversation

@sunng87

@sunng87 sunng87 commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

Add a compact command to testbedctl, mirroring the existing flush command. It triggers GreptimeDB's admin compact_table(...) against the client PostgreSQL port (11043), so it works identically in distributed (haproxy), standalone, standalone-fs, and active/standby modes.

Usage

./testbedctl compact my_table                          # admin compact_table('my_table')
./testbedctl compact my_table twcs                     # admin compact_table('my_table', 'twcs')
./testbedctl compact my_table twcs 'parallelism=4'     # admin compact_table('my_table', 'twcs', 'parallelism=4')

The table name is always the first argument; any extra args are forwarded as the compaction type (twcs/swcs) and type-specific options (e.g. parallelism=N), matching GreptimeDB's compact_table signature. Listed in testbedctl help, and follows the same usage/exit-1 pattern as flush.

Verification

  • bash -n testbedctl passes.
  • All three arg forms produce the expected SQL (verified with a stub psql).
  • testbedctl help shows the new command.

Add `testbedctl compact <table> [type] [options]`, mirroring the existing
`flush` command. It runs `admin compact_table(...)` against the client
PostgreSQL port (11043). Any extra args are forwarded as the compaction type
(twcs/swcs) and type-specific options (e.g. parallelism=4).

  testbedctl compact my_table
  testbedctl compact my_table twcs
  testbedctl compact my_table twcs 'parallelism=4'
@sunng87
sunng87 merged commit 8ba05aa into main Jul 23, 2026
4 checks passed
@sunng87
sunng87 deleted the feat/testbedctl-compact branch July 23, 2026 13:23
sunng87 added a commit that referenced this pull request Jul 23, 2026
Add the flush and compact commands to the testbedctl command lists in
AGENTS.md and README.md (compact was added in #2 but the docs were missed;
flush was previously undocumented too).
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.

1 participant