Skip to content

pg_autoctl: add commands and options required by the pgaftest runner - #1135

Merged
dimitri merged 1 commit into
mainfrom
pg_autoctl/pgaftest-prereqs
Jul 9, 2026
Merged

pg_autoctl: add commands and options required by the pgaftest runner#1135
dimitri merged 1 commit into
mainfrom
pg_autoctl/pgaftest-prereqs

Conversation

@dimitri

@dimitri dimitri commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Four small additions to pg_autoctl that the upcoming pgaftest binary and its .pgaf test specs depend on. No new external dependencies — all changes build on existing infrastructure already in main.

Changes

pg_autoctl do pgsetup hba-lan (cli_do_root.c, cli_do_misc.c)
Appends LAN CIDR trust rules to pg_hba.conf and reloads Postgres. Used by Citus pgaftest specs to configure cross-container authentication without rewriting the entire HBA file.

pg_autoctl do pgsetup wait --timeout N (cli_do_root.c, cli_do_misc.c)
Dedicated getopts function accepting --pgdata and --timeout; the previous getopts was shared with the keeper setup path and silently ignored --timeout, so callers could not set a custom wait budget.

pg_autoctl drop node --no-wait (cli_drop_node.c)
Sets listen_notifications_timeout to 0, skipping the wait for monitor confirmation. Used by pgaftest teardown steps when the monitor container is already gone.

pg_autoctl create postgres --replication-password / --monitor-password (cli_common.c)
Accepts the passwords emitted by pg_autoctl node run when a nodespec.ini has auth configured. Without this, the container exits immediately with "unrecognised option".

Testing

  • Style check: passes (citus_indent --check clean)
  • TEST=monitor make run-test (PG17): 19 passed — the 1 failure (test_replace_monitor::test_001_init_primary) reproduces identically on main with no changes (pre-existing flake, state-file race at startup)

Four additions that pgaftest specs and the pg_autoctl node runner depend on:

1. pg_autoctl do pgsetup hba-lan
   Appends LAN CIDR trust rules to pg_hba.conf and reloads Postgres.
   Used by citus pgaftest specs to configure cross-container auth.

2. pg_autoctl do pgsetup wait --timeout N
   Dedicated getopts accepting --pgdata and --timeout N; the previous
   shared getopts silently ignored --timeout, so callers could not
   set a custom wait budget.

3. pg_autoctl drop node --no-wait
   Sets listen_notifications_timeout to 0 (skip waiting for monitor
   confirmation); used by pgaftest teardown when the monitor is absent.

4. pg_autoctl create postgres --replication-password / --monitor-password
   Accepts the passwords emitted by pg_autoctl node run when a
   nodespec.ini has auth configured, preventing container exit(1) on
   unrecognised options.
@dimitri dimitri self-assigned this Jul 9, 2026
@dimitri dimitri added enhancement New feature or request Developer productivity Enhancements to ability to ship quality code labels Jul 9, 2026
@dimitri
dimitri merged commit 90b7d0e into main Jul 9, 2026
51 of 52 checks passed
@dimitri
dimitri deleted the pg_autoctl/pgaftest-prereqs branch July 9, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Developer productivity Enhancements to ability to ship quality code enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant