Skip to content

feat(gpbackup): add find-table subcommand - #45

Merged
adityatoshniwal merged 2 commits into
mainfrom
find-table
Aug 20, 2026
Merged

feat(gpbackup): add find-table subcommand#45
adityatoshniwal merged 2 commits into
mainfrom
find-table

Conversation

@adityatoshniwal

Copy link
Copy Markdown
Contributor

Add find-table CLI command that scans backup history to locate which backups contain a given schema.table, checking backups concurrently (bounded by findTableScanConcurrency) since each check is I/O-bound (history DB query + TOC file read). A backup whose history entry or TOC can't be read is skipped with a warning instead of aborting the scan.

Output supports --format text/json, sharing list-backups' printers, column set, and graceful "no history db / no matches" handling. Skip warnings are routed to stderr in json mode since gplog.Warn writes to stdout and would otherwise corrupt the JSON.

Also factors the coordinator FilePathInfo builder out of delete-backup into a shared helper, coordinatorFPInfo, now used by both commands.

@adityatoshniwal
adityatoshniwal requested review from a team and haolinw August 19, 2026 10:18
Add find-table CLI command that scans backup history to locate which
backups contain a given schema.table, checking backups concurrently
(bounded by findTableScanConcurrency) since each check is I/O-bound
(history DB query + TOC file read). A backup whose history entry or
TOC can't be read is skipped with a warning instead of aborting the
scan.

Output supports --format text/json, sharing list-backups' printers,
column set, and graceful "no history db / no matches" handling. Skip
warnings are routed to stderr in json mode since gplog.Warn writes to
stdout and would otherwise corrupt the JSON.

Also factors the coordinator FilePathInfo builder out of delete-backup
into a shared helper, coordinatorFPInfo, now used by both commands.
Comment thread gpbackup.go
Comment thread history/history.go
…ist-backups order

find-table previously included backups whose delete attempt failed
(local or plugin), and sorted oldest-first. Exclude those backups and
sort newest-first to match list-backups.

@haolinw haolinw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@adityatoshniwal
adityatoshniwal merged commit 0504c7e into main Aug 20, 2026
4 checks passed
@adityatoshniwal
adityatoshniwal deleted the find-table branch August 20, 2026 10:34
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