Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
91d36e9
feat: pg_autoctl node — declarative node lifecycle from pg_autoctl_no…
dimitri Jul 6, 2026
8c5f873
docs,feat: refine pg_autoctl node docs and make ssl mutable
dimitri Jul 6, 2026
2455139
nodespec: make monitor_pguri mutable via disable/enable monitor
dimitri Jul 6, 2026
6a860c2
docs: complete pg_autoctl node sub-command pages, remove Container se…
dimitri Jul 6, 2026
2882a0b
docs: replace list-table with definition-list style in pg_autoctl_node
dimitri Jul 6, 2026
e504faf
docs: restore Container/K8s section in operations.rst, note in Provis…
dimitri Jul 6, 2026
466f812
docs: add pg_autoctl node cross-references throughout the manual
dimitri Jul 6, 2026
b77609a
docs: rewrite tutorial to use pg_autoctl node run
dimitri Jul 6, 2026
c3c81d7
docs: clarify candidate_priority change — direct command and ini file…
dimitri Jul 6, 2026
2b3d11b
docs: rewrite Citus tutorial to use pg_autoctl node run
dimitri Jul 6, 2026
d2d4684
style: apply citus_indent to nodespec.c
dimitri Jul 6, 2026
c57cf3b
style: fix nodespec.c PUSH macro indentation per citus_indent
dimitri Jul 6, 2026
bb5e09a
feat: add src/bin/common/ shared library, pgaftest binary and .pgaf s…
dimitri Jul 6, 2026
b0917c5
chore: untrack pgaftest binary, add to .gitignore
dimitri Jul 6, 2026
a648f0a
ci: expand pgaftest workflow to full PG14-17 matrix
dimitri Jul 6, 2026
04abed7
feat: pgaftest setup --tmux opens interactive 3-pane session
dimitri Jul 6, 2026
7c0303b
fix: parse options that follow the spec file path (pgaftest setup spe…
dimitri Jul 6, 2026
ef2beca
pgaftest: fix setup --tmux timing, fix down --work-dir, add docs
dimitri Jul 6, 2026
6ff5939
pgaftest: fix setup --tmux timing, fix down --work-dir, update docs (…
dimitri Jul 6, 2026
d854104
style: fix build-time warnings
dimitri Jul 6, 2026
9170315
docs: move pgaftest into the Manual Pages toctree
dimitri Jul 6, 2026
21bdda8
merge: resolve conflict in docs/operations.rst with origin/main
dimitri Jul 6, 2026
24ad477
refactor: remove duplicate source files from src/bin/pg_autoctl/
dimitri Jul 6, 2026
1089854
ci: fix banned function check for pgaftest files
dimitri Jul 7, 2026
e88009b
Dockerfile: revert CITUSTAG to v12.1.5 to restore PG14 support
dimitri Jul 7, 2026
bff39c8
ci: fix banned functions in pgaftest using project-approved wrappers
dimitri Jul 7, 2026
98e746e
ci: fix per-version CITUSTAG in run-pgaftest.yml
dimitri Jul 7, 2026
2ec04ea
ci: update GitHub Actions versions to Node 24-compatible releases
dimitri Jul 7, 2026
c6036fe
Remove local-only planning file from PR
dimitri Jul 7, 2026
5d604b4
Fix CI failures: missing pg_autoctl options and installcheck CITUSTAG
dimitri Jul 7, 2026
4f1b859
tests: fix spec timeouts and pg_ctl path for CI runners
dimitri Jul 7, 2026
7e0c807
style: apply citus_indent formatting
dimitri Jul 7, 2026
a0ab8e6
style: re-apply citus_indent from repo root (matching CI)
dimitri Jul 7, 2026
7f2ee81
restore: use original implementations from pgaftest-infra branch
dimitri Jul 7, 2026
61c077a
fix: resolve undeclared root_with_debug and internal_commands symbols
dimitri Jul 7, 2026
cdcb4d8
tests: add node-extra, citus-1, citus-2 schedules; include all specs …
dimitri Jul 7, 2026
f74fe76
tests: fix CI flakes in basic_operation, auth, and enable_ssl specs
dimitri Jul 7, 2026
a57d3c6
pgaftest: fix 4 CI failure patterns from run 28875391958
dimitri Jul 7, 2026
0c7a8ee
pgaftest: fix 6 more CI failures; consolidate schedules; restrict slo…
dimitri Jul 7, 2026
a9a47e4
pgaftest: drain-at-start in runner_wait_notify_goal, remove SQL confi…
dimitri Jul 7, 2026
0702211
pgaftest: fix test_022 demote_timeout wait for disconnected node
dimitri Jul 7, 2026
9dc7464
pgaftest: ssl client cert for monitor LISTEN; wider healthcheck window
dimitri Jul 7, 2026
efd3fdf
pgaftest: fix ssl client key permissions for runner LISTEN connection
dimitri Jul 7, 2026
67a3548
keeper: use cert map=pgautofailover for replication HBA with cert auth
dimitri Jul 7, 2026
a2ce2b6
Fix upstream_has_replication_slot() to authenticate with md5
dimitri Jul 7, 2026
603a5e8
CI: run pgaftest inside pgaf:pgaftest container (Docker-out-of-Docker)
dimitri Jul 7, 2026
eee4e9e
CI: fix docker socket access in pgaf:pgaftest container
dimitri Jul 7, 2026
e393a46
CI: chmod 777 /tmp/pgaftest before docker run
dimitri Jul 7, 2026
c28db09
tests: fix test_024_stop_postgres_monitor in basic_operation
dimitri Jul 7, 2026
53d7f36
Fix three CI failures: multi_ifdown, citus_skip_pg_hba, deferred heal…
dimitri Jul 7, 2026
3ff20b7
citus_skip_pg_hba: fix hba-lan command path (inspect not override)
dimitri Jul 8, 2026
4b4ccce
multi_ifdown test_014: revert to compose stop, keep background failover
dimitri Jul 8, 2026
442b550
specs: fix transient-state polling races in multi_ifdown and citus_sk…
dimitri Jul 8, 2026
062622d
fix CI failures: ssl healthcheck timeout and multi_async test_011 race
dimitri Jul 8, 2026
1abc6b9
compose_gen: add monitor healthcheck; node1 depends_on monitor
dimitri Jul 8, 2026
de05007
compose_gen: pgaftest service depends_on node1 healthy
dimitri Jul 8, 2026
2e13243
compose_gen: explicit SSL params in monitor pguri for cert clusters; …
dimitri Jul 8, 2026
2005f8c
Dockerfile: migrate from Bullseye to Bookworm; dump container logs on…
dimitri Jul 8, 2026
75dda28
Dockerfile: drop pip3 pyroute2 install (Bookworm PEP 668 + unused)
dimitri Jul 8, 2026
016e35b
Dockerfile: restore nose and pyroute2 via pip for old Python tests
dimitri Jul 8, 2026
7f269be
style: citus_indent compose_gen.c
dimitri Jul 8, 2026
1efe48b
tests: switch to pytest for old Python tests on Bookworm
dimitri Jul 8, 2026
e0de39f
tests: use tests/*.py glob to exclude tablespaces subdirectory from p…
dimitri Jul 8, 2026
bfef1b3
tests: fix all run-tests.yml failures and improve pgaftest spec robus…
dimitri Jul 8, 2026
8ce4d33
tests: fix pgaftest specDir host path, FSM timing races, and tablespa…
dimitri Jul 8, 2026
77654df
monitor: fix IntString dangling pointers; network.py: tolerate non-UT…
dimitri Jul 8, 2026
a913eab
ci: rebalance pgaftest schedules, gate all jobs on style check
dimitri Jul 9, 2026
0d16d2e
src: delete dead azure #if 0 block from cli_do_root.c
dimitri Jul 9, 2026
72b653d
cleanup: remove azure Makefile, pipenv, stale comments and wrong job …
dimitri Jul 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
358 changes: 358 additions & 0 deletions .github/workflows/run-pgaftest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,358 @@
name: pgaftest

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

# One run per branch; cancel in-progress runs on new push.
concurrency:
group: pgaftest-${{ github.ref }}
cancel-in-progress: true

jobs:
style_checker:
name: Style check
runs-on: ubuntu-latest
container: citus/stylechecker:no-py
steps:
- name: Checkout repository
uses: actions/checkout@v7.0.0

- name: Set safe directory for git
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}

- name: Check C formatting
run: citus_indent --check

- name: Check banned functions
run: ci/banned.h.sh

# ---------------------------------------------------------------------------
# Build one pgaf:run image per Postgres version and upload each as an
# artifact. All downstream test jobs download only the version they need.
# ---------------------------------------------------------------------------
build-images:
name: Build image (PG${{ matrix.PGVERSION }})
needs: style_checker
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
PGVERSION: [14, 15, 16, 17]

steps:
- uses: actions/checkout@v7.0.0

- name: Generate git-version.h
run: make version

- name: Build pgaf:run image (PG${{ matrix.PGVERSION }})
run: |
# Match the CITUSTAG-per-PGVERSION logic from the top-level Makefile:
# PG14–15 require Citus v12 (last version supporting those releases).
# PG16+ use the current default.
case "${{ matrix.PGVERSION }}" in
14|15) CITUSTAG=v12.1.5 ;;
*) CITUSTAG=v13.2.0 ;;
esac
docker build \
--build-arg PGVERSION=${{ matrix.PGVERSION }} \
--build-arg CITUSTAG=${CITUSTAG} \
--target run \
-t pgaf:run-pg${{ matrix.PGVERSION }} \
.

- name: Build pgaf:debian image (PG${{ matrix.PGVERSION }})
run: |
# Layer cache from the run build above covers the run stage;
# this step only adds the pg_createcluster layer on top.
case "${{ matrix.PGVERSION }}" in
14|15) CITUSTAG=v12.1.5 ;;
*) CITUSTAG=v13.2.0 ;;
esac
docker build \
--build-arg PGVERSION=${{ matrix.PGVERSION }} \
--build-arg CITUSTAG=${CITUSTAG} \
--target debian \
-t pgaf:debian-pg${{ matrix.PGVERSION }} \
.

- name: Save images to tarballs
run: |
docker save pgaf:run-pg${{ matrix.PGVERSION }} \
| gzip > /tmp/pgaf-run-pg${{ matrix.PGVERSION }}.tar.gz
docker save pgaf:debian-pg${{ matrix.PGVERSION }} \
| gzip > /tmp/pgaf-debian-pg${{ matrix.PGVERSION }}.tar.gz

- name: Upload run image artifact
uses: actions/upload-artifact@v7.0.1
with:
name: pgaf-run-image-pg${{ matrix.PGVERSION }}
path: /tmp/pgaf-run-pg${{ matrix.PGVERSION }}.tar.gz
retention-days: 1

- name: Upload debian image artifact
uses: actions/upload-artifact@v7.0.1
with:
name: pgaf-debian-image-pg${{ matrix.PGVERSION }}
path: /tmp/pgaf-debian-pg${{ matrix.PGVERSION }}.tar.gz
retention-days: 1

# ---------------------------------------------------------------------------
# Build the pgaf:pgaftest image once from the PG17 build image.
# The Dockerfile pgaftest target bundles the pgaftest binary together with
# its runtime dependencies (libpq5 from PGDG, docker-ce-cli, and the
# docker-compose-plugin) so that test jobs run pgaftest inside this
# container via Docker-out-of-Docker rather than installing libpq on the
# bare runner. That eliminates the fragile apt-get dependency on the
# pre-installed Microsoft package repositories on GitHub's runner image.
# ---------------------------------------------------------------------------
build-pgaftest:
name: Build pgaftest image
needs: style_checker
runs-on: ubuntu-latest
env:
PGVERSION: 17

steps:
- uses: actions/checkout@v7.0.0

- name: Generate git-version.h
run: make version

- name: Build pgaf:pgaftest image (PG${{ env.PGVERSION }})
run: |
docker build \
--build-arg PGVERSION=${{ env.PGVERSION }} \
--build-arg CITUSTAG=v13.2.0 \
--target pgaftest \
-t pgaf:pgaftest \
.

- name: Save image to tarball
run: docker save pgaf:pgaftest | gzip > /tmp/pgaf-pgaftest.tar.gz

- name: Upload pgaftest image artifact
uses: actions/upload-artifact@v7.0.1
with:
name: pgaftest-image
path: /tmp/pgaf-pgaftest.tar.gz
retention-days: 1

# ---------------------------------------------------------------------------
# Run test schedules. Fast schedules (quick, node, ssl) run against all four
# Postgres versions. Slow schedules (multi-*, citus-*) run PG17 only.
# Total: 3×4 + 5×1 = 17 test jobs — keeps GitHub shared-runner queue short.
# ---------------------------------------------------------------------------
test:
name: pgaftest / ${{ matrix.schedule }} (PG${{ matrix.PGVERSION }})
needs: [build-images, build-pgaftest]
runs-on: ubuntu-latest
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
# Fast/medium schedules run against all four Postgres versions.
# Slow schedules (multi-*, citus-*) run PG17 only: they exercise
# pg_auto_failover FSM logic, not Postgres version-specific code paths,
# and restricting them reduces total job count from 36 to 17 — avoiding
# GitHub Actions shared-runner queue saturation that was adding 10-15 min
# of queue wait to every run.
include:
# quick: basic_operation, basic_operation_listen_flag, config_get_set, skip_pg_hba
- { PGVERSION: 14, schedule: quick }
- { PGVERSION: 15, schedule: quick }
- { PGVERSION: 16, schedule: quick }
- { PGVERSION: 17, schedule: quick }
# node: create_standby_with_pgdata, maintenance_and_drop, auth,
# monitor_disabled, replace_monitor, extension_update,
# debian_clusters, tablespaces
- { PGVERSION: 14, schedule: node }
- { PGVERSION: 15, schedule: node }
- { PGVERSION: 16, schedule: node }
- { PGVERSION: 17, schedule: node }
# ssl: enable_ssl, ssl_self_signed, ssl_cert
- { PGVERSION: 14, schedule: ssl }
- { PGVERSION: 15, schedule: ssl }
- { PGVERSION: 16, schedule: ssl }
- { PGVERSION: 17, schedule: ssl }
# slow schedules: PG17 only
- { PGVERSION: 17, schedule: multi-alternate } # multi_alternate
- { PGVERSION: 17, schedule: multi-misc } # multi_standbys, multi_maintenance, ensure, multi_ifdown
- { PGVERSION: 17, schedule: multi-async } # multi_async
- { PGVERSION: 17, schedule: citus-1 } # citus_cluster_name, citus_force_failover, citus_multi_standbys
- { PGVERSION: 17, schedule: citus-2 } # basic_citus_operation, nonha_citus_operation, citus_skip_pg_hba

steps:
- uses: actions/checkout@v7.0.0

- name: Download pgaf:run image (PG${{ matrix.PGVERSION }})
uses: actions/download-artifact@v8.0.1
with:
name: pgaf-run-image-pg${{ matrix.PGVERSION }}
path: /tmp

- name: Load pgaf:run image into Docker
run: |
docker load < /tmp/pgaf-run-pg${{ matrix.PGVERSION }}.tar.gz
# Alias to the name pgaftest expects via PGAF_IMAGE
docker tag pgaf:run-pg${{ matrix.PGVERSION }} pgaf:run

- name: Download pgaf:debian image (PG${{ matrix.PGVERSION }})
if: matrix.schedule == 'node'
uses: actions/download-artifact@v8.0.1
with:
name: pgaf-debian-image-pg${{ matrix.PGVERSION }}
path: /tmp

- name: Load pgaf:debian image into Docker
if: matrix.schedule == 'node'
run: |
docker load < /tmp/pgaf-debian-pg${{ matrix.PGVERSION }}.tar.gz
docker tag pgaf:debian-pg${{ matrix.PGVERSION }} pgaf:debian

- name: Download pgaf:pgaftest image
uses: actions/download-artifact@v8.0.1
with:
name: pgaftest-image
path: /tmp

- name: Load pgaf:pgaftest image into Docker
run: docker load < /tmp/pgaf-pgaftest.tar.gz

- name: Run schedule ${{ matrix.schedule }}
timeout-minutes: 35
run: |
mkdir -p /tmp/pgaftest && chmod 777 /tmp/pgaftest
DOCKER_GID=$(stat -c '%g' /var/run/docker.sock)
docker run --rm \
--user root \
--group-add "${DOCKER_GID}" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/pgaftest:/tmp/pgaftest \
-v "$(pwd)":/work:ro \
-w /work \
-e PGAF_IMAGE=pgaf:run \
-e PGVERSION=${{ matrix.PGVERSION }} \
-e PGAF_DEBIAN_IMAGE=${{ matrix.schedule == 'node' && 'pgaf:debian' || '' }} \
-e PGAFTEST_HOST_WORK_DIR="$(pwd)" \
pgaf:pgaftest \
pgaftest run --schedule tests/tap/schedules/${{ matrix.schedule }}.sch

# ---------------------------------------------------------------------------
# installcheck: SQL regression suite via pg_regress.
# Runs on all supported Postgres versions; builds pgaf:testrun inline since
# it needs postgresql-server-dev which isn't in the run image.
# ---------------------------------------------------------------------------
installcheck:
name: pgaftest / installcheck (PG${{ matrix.PGVERSION }})
needs: build-pgaftest
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
PGVERSION: [14, 15, 16, 17]

steps:
- uses: actions/checkout@v7.0.0

- name: Download pgaf:pgaftest image
uses: actions/download-artifact@v8.0.1
with:
name: pgaftest-image
path: /tmp

- name: Load pgaf:pgaftest image into Docker
run: docker load < /tmp/pgaf-pgaftest.tar.gz

- name: Generate git-version.h
run: make version

- name: Build pgaf:testrun image (PG${{ matrix.PGVERSION }})
run: |
case "${{ matrix.PGVERSION }}" in
14|15) CITUSTAG=v12.1.5 ;;
*) CITUSTAG=v13.2.0 ;;
esac
docker build \
--build-arg PGVERSION=${{ matrix.PGVERSION }} \
--build-arg CITUSTAG=${CITUSTAG} \
--target testrun \
-t pgaf:testrun \
.

- name: Run installcheck spec
timeout-minutes: 15
run: |
mkdir -p /tmp/pgaftest && chmod 777 /tmp/pgaftest
DOCKER_GID=$(stat -c '%g' /var/run/docker.sock)
docker run --rm \
--user root \
--group-add "${DOCKER_GID}" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/pgaftest:/tmp/pgaftest \
-v "$(pwd)":/work:ro \
-w /work \
-e PGAFTEST_HOST_WORK_DIR="$(pwd)" \
pgaf:pgaftest \
pgaftest run tests/tap/specs/installcheck.pgaf

# ---------------------------------------------------------------------------
# Upgrade test: binary + extension swap without container restart.
# Pinned to PG16 (the upgrade path always runs N-1 → current).
# Builds its own pgaf:next and pgaf:current images from the upgrade Makefile.
# ---------------------------------------------------------------------------
upgrade:
name: pgaftest / upgrade
needs: build-pgaftest
runs-on: ubuntu-latest
timeout-minutes: 30
env:
PGVERSION: 16

steps:
- uses: actions/checkout@v7.0.0
with:
# Full history needed so PREV_TAG auto-detection finds the right tag.
fetch-depth: 0

- name: Download pgaf:pgaftest image
uses: actions/download-artifact@v8.0.1
with:
name: pgaftest-image
path: /tmp

- name: Load pgaf:pgaftest image into Docker
run: docker load < /tmp/pgaf-pgaftest.tar.gz

- name: Generate git-version.h
run: make version

- name: Build pgaf:next (current branch, PG${{ env.PGVERSION }})
run: make -C tests/upgrade pgaf-next PGVERSION=${{ env.PGVERSION }}

- name: Build pgaf:current (previous release, PG${{ env.PGVERSION }})
run: make -C tests/upgrade pgaf-current PGVERSION=${{ env.PGVERSION }}

- name: Run upgrade spec
timeout-minutes: 25
run: |
mkdir -p /tmp/pgaftest && chmod 777 /tmp/pgaftest
DOCKER_GID=$(stat -c '%g' /var/run/docker.sock)
docker run --rm \
--user root \
--group-add "${DOCKER_GID}" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/pgaftest:/tmp/pgaftest \
-v "$(pwd)":/work:ro \
-w /work \
-e PGVERSION=${{ env.PGVERSION }} \
-e PGAFTEST_HOST_WORK_DIR="$(pwd)" \
pgaf:pgaftest \
pgaftest run tests/tap/specs/upgrade.pgaf
1 change: 1 addition & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:

build_images:
name: Build test image (PG${{ matrix.PGVERSION }})
needs: style_checker
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ docs/tikz/*.png
# Exclude our demo/test tmux directory
tmux/
valgrind/
*.tmp
src/bin/pgaftest/test_spec_parse.tab.*
src/bin/pgaftest/test_spec_parse.output
src/bin/pgaftest/pgaftest
Loading
Loading