$ which gpbackman
/usr/local/cloudberry/bin/gpbackman
$ cd /tmp # any directory without a history DB
$ gpbackman backup-info
[ERROR]:-Unable to read data from history db. Error: no such table: backups
$ ls /tmp/gpbackup_history.db
-rw-r--r-- 1 gpadmin gpadmin 0 Apr 29 12:40 /tmp/gpbackup_history.db
^^^ silently created, polluting cwd
Expected behaviour
- When --history-db is omitted, gpbackman should look up
$COORDINATOR_DATA_DIRECTORY/gpbackup_history.db (and then
$MASTER_DATA_DIRECTORY/gpbackup_history.db for older installs)
before falling back to cwd. This matches how operators already
source the cluster environment.
- When the resolved file does not exist, gpbackman should fail loud
with a clear, actionable error and not create an empty SQLite
database on disk.
Why this matters
- Operators routinely run gpbackman from ~ after sourcing
greenplum_path.sh / equivalent. Today they must always type the
full coordinator path, which is fragile across cluster layouts.
- The "silent create + cryptic later error" UX has bitten me during
exploration; the failure mode is non-local and easy to misdiagnose
as a corrupt history database.
### What you think should happen instead
Proposed approach
- Resolve --history-db empty → $COORDINATOR_DATA_DIRECTORY →
$MASTER_DATA_DIRECTORY → bare filename in cwd (last resort,
preserves existing behaviour).
- In OpenHistoryDB, pre-check with os.Stat and open SQLite via the
file:<path>?mode=rw URI (read+write but never create).
- Friendly error message that names the missing path and points at the
flag and env vars.
### Operating System
rockylinux 9.x / RHEL 9.X
Apache Cloudberry and cloudberry-backup version
cloudberry 2.0.x & 2.1.x
cloudberry-backup main
What happened
Summary
gpbackmanmakes two reasonable defaults harder than they need to be:--history-dbflag has no fallback to the standard$COORDINATOR_DATA_DIRECTORY/$MASTER_DATA_DIRECTORYenv varsthat the Cloudberry/Greenplum environment scripts already set.
empty database, and the next query fails with the misleading
no such table: backups. An emptygpbackup_history.dbis alsoleft behind in
cwd, polluting unrelated working directories.Reproduce on
main