From nobody Sun Feb 22 16:55:08 2026 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fJqq04XpNz6TRB7 for ; Sun, 22 Feb 2026 16:55:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fJqq038Fzz3pmW for ; Sun, 22 Feb 2026 16:55:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771779308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oyKoACbS5lmII5A8LdDdsiEqRGbK5Y4+YXIvrinDgtc=; b=nVY371cv0SKfkj7VxonenfQdc8HBCmgHweeR9hEGd1+UKkNx4QNBEkKPuqxUO0LRMP/7mL k+9ib51h90Ny1KthH8Nk/3PHHUsUjxxDOFE1Jd2KsZLW3UtPBJc+7kjfGIUuSPPKz61J/H k4nn9qSBiHUGzog/cnLgX74HvZi4SVZg6FlhwtqYm6htDlwTtJKI5J/KGcMOvRyZ6QbXp1 lLNDsWVjYpqMkYOaCF0ej9jXLY2bZEwwMRiwREV2POGEnYOu8vz2wc4Qk4MTOB3BAYo03R 5UJw8Rcpyr790bO66qDnbgJc6JNqAu+TS3bV7fZCWRdz0fDLOxcSE351KKn1SQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1771779308; a=rsa-sha256; cv=none; b=BimWaRX4s1pUjs5Or+R5KwRO6qg9bpbb2/M2tzSc7R7AV9iRO+1siK3yRr3dKBsnmCIoCL fnGjQ1dPo7wUwRsZxaG7RJI2FvUZMDiTroerLtebfHS9oGuepXqSEHr2ighuEzQX74n1VD ZdXClJwYD8l39agQlw9tofuXycycuKdTmc6TkfSTIJeCaGoTFa6bxgiYI0mZ6sd2f/7aF/ KdWbb++PTrAcWj0CUQKdUMejiDiD6NhJURWuxYNjzjZUwmBxGO243/9PaKiQeFwjBae46x PO0qgG/4qqHw6iQ8iseqFGXZKwfMbOore+o1ZtB2Sz0y85BawB5kt7fwRODvRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771779308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oyKoACbS5lmII5A8LdDdsiEqRGbK5Y4+YXIvrinDgtc=; b=RoFBUi2lkOnmyzZlC0uFfQL5fiZRX1c/QSnGl2LxEhPqGt9rwnec9tXE1Hrwskwm7ZiKSW 4hDRiFrilUBUQwuTctKY+J877lS6auvej04ksKziRosn95VML55mtVrEdT+BEUzKMQ7m9E jr4cOVA93Ps5tL0fJemMNIrI/Vdp1WT78fYO6uJO7GkwrrTfwJ6ldOJzIbRyLoiRVsoq2g IAXoPLtRAjEkDGl1AachSLlqh2lbKCIjRmLazDJwu0Bx2XhggiGj9v1AqYV+SKhiC8/nTK Vhb2emBWnplzGihVEfn6qMidUix2Pe2IZhAyruShRQf+lwU8KEHmpcL2uE3WPg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fJqq02jJFzsxJ for ; Sun, 22 Feb 2026 16:55:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 362a2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 22 Feb 2026 16:55:08 +0000 To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Cc: Pat Maddox From: Dave Cottlehuber Subject: git: cac7f24191df - main - databases/pg_auto_failover-devel: new port: PG extension for automated failover and HA List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-all@freebsd.org Sender: owner-dev-commits-ports-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dch X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cac7f24191df18d1cec7f52ad3e8097432330641 Auto-Submitted: auto-generated Date: Sun, 22 Feb 2026 16:55:08 +0000 Message-Id: <699b34ec.362a2.4b8de1a3@gitrepo.freebsd.org> The branch main has been updated by dch: URL: https://cgit.FreeBSD.org/ports/commit/?id=cac7f24191df18d1cec7f52ad3e8097432330641 commit cac7f24191df18d1cec7f52ad3e8097432330641 Author: Pat Maddox AuthorDate: 2026-02-22 16:51:43 +0000 Commit: Dave Cottlehuber CommitDate: 2026-02-22 16:52:01 +0000 databases/pg_auto_failover-devel: new port: PG extension for automated failover and HA WWW: https://pg-auto-failover.readthedocs.io PR: 292994 --- databases/Makefile | 1 + databases/pg_auto_failover-devel/Makefile | 32 +++++++++ databases/pg_auto_failover-devel/distinfo | 3 + .../files/pg_auto_failover.in | 76 ++++++++++++++++++++++ databases/pg_auto_failover-devel/pkg-descr | 26 ++++++++ databases/pg_auto_failover-devel/pkg-plist | 15 +++++ databases/pg_auto_failover/Makefile | 2 + 7 files changed, 155 insertions(+) diff --git a/databases/Makefile b/databases/Makefile index bdbca3e34739..fc8a621c1441 100644 --- a/databases/Makefile +++ b/databases/Makefile @@ -543,6 +543,7 @@ SUBDIR += pgFormatter SUBDIR += pg_activity SUBDIR += pg_auto_failover + SUBDIR += pg_auto_failover-devel SUBDIR += pg_citus SUBDIR += pg_cron SUBDIR += pg_dirtyread diff --git a/databases/pg_auto_failover-devel/Makefile b/databases/pg_auto_failover-devel/Makefile new file mode 100644 index 000000000000..d8ebb2528785 --- /dev/null +++ b/databases/pg_auto_failover-devel/Makefile @@ -0,0 +1,32 @@ +PORTNAME= pg_auto_failover +DISTVERSION= g20251117 +CATEGORIES= databases +PKGNAMEPREFIX= postgresql${PGSQL_VER_NODOT}- +PKGNAMESUFFIX= -devel + +MAINTAINER= pat@patmaddox.com +COMMENT= Postgres extension for automated failover and high-availability +WWW= https://pg-auto-failover.readthedocs.io + +LICENSE= PostgreSQL +LICENSE_FILE= ${WRKSRC}/LICENSE + +__MAX_PGSQL= 18 +USES= gmake pgsql:13-${__MAX_PGSQL} +WANT_PGSQL= contrib server + +USE_GITHUB= yes +GH_ACCOUNT= hapostgres +GH_TAGNAME= 5f31d4f5ef322b339d67cfd79d773e11f9e30fb0 + +USE_RC_SUBR= pg_auto_failover + +CONFLICTS= postgresql*-pg_auto_failover* + +.include + +.if ${PGSQL_DEFAULT} > ${__MAX_PGSQL} +PGSQL_VER= ${__MAX_PGSQL} +.endif + +.include diff --git a/databases/pg_auto_failover-devel/distinfo b/databases/pg_auto_failover-devel/distinfo new file mode 100644 index 000000000000..57922de56911 --- /dev/null +++ b/databases/pg_auto_failover-devel/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1770366586 +SHA256 (hapostgres-pg_auto_failover-g20251117-5f31d4f5ef322b339d67cfd79d773e11f9e30fb0_GH0.tar.gz) = d9aef136094c1f90ca39221155b95df04d7e209662b1a715740bfbe14cac5221 +SIZE (hapostgres-pg_auto_failover-g20251117-5f31d4f5ef322b339d67cfd79d773e11f9e30fb0_GH0.tar.gz) = 1142071 diff --git a/databases/pg_auto_failover-devel/files/pg_auto_failover.in b/databases/pg_auto_failover-devel/files/pg_auto_failover.in new file mode 100644 index 000000000000..bfb500a58924 --- /dev/null +++ b/databases/pg_auto_failover-devel/files/pg_auto_failover.in @@ -0,0 +1,76 @@ +#!/bin/sh + +# PROVIDE: pg_auto_failover +# REQUIRE: DAEMON mountlate +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# pg_auto_failover_enable (bool): Set to NO by default. +# Set it to YES to enable pg_auto_failover. +# pg_auto_failover_user (string): Set user to run pg_autoctl +# Default is "postgres". +# pg_auto_failover_pgdata (path): REQUIRED. Set the PGDATA directory. +# This should point to your monitor or keeper data directory. +# No default - must be explicitly configured. +# pg_auto_failover_name (string): Optional friendly name for the node. +# Useful for distinguishing nodes in monitor logs. +# Default is "". +# pg_auto_failover_hostname (string): Optional hostname or IP for node. +# Used by other nodes to connect to this node. +# Default is "" (pg_autoctl will auto-detect). +# pg_auto_failover_pgport (int): PostgreSQL port number. +# Default is "". + +. /etc/rc.subr + +name="pg_auto_failover" +rcvar="${name}_enable" +pidfile="/var/run/${name}.pid" +logfile="/var/log/${name}.log" + +command="/usr/sbin/daemon" +procname="%%PREFIX%%/bin/pg_autoctl" +start_cmd="${name}_start" + +load_rc_config ${name} +: ${pg_auto_failover_enable:=no} +: ${pg_auto_failover_user:=postgres} +: ${pg_auto_failover_name:=""} +: ${pg_auto_failover_hostname:=""} +: ${pg_auto_failover_pgport:=""} + +start_precmd=pg_auto_failover_startprecmd + +pg_auto_failover_startprecmd() { + if [ -z "${pg_auto_failover_pgdata}" ]; then + err 1 "pg_auto_failover_pgdata is not set" + fi + if checkyesno postgresql_enable 2>/dev/null; then + err 1 "postgresql_enable must be NO when using pg_auto_failover (pg_autoctl manages PostgreSQL)" + fi +} + +pg_auto_failover_start() { + local args + args="--pgdata ${pg_auto_failover_pgdata}" + + if [ -n "${pg_auto_failover_pgport}" ]; then + args="${args} --pgport ${pg_auto_failover_pgport}" + fi + if [ -n "${pg_auto_failover_name}" ]; then + args="${args} --name ${pg_auto_failover_name}" + fi + if [ -n "${pg_auto_failover_hostname}" ]; then + args="${args} --hostname ${pg_auto_failover_hostname}" + fi + + ${command} -t ${name} \ + -p ${pidfile} \ + -f -H -o ${logfile} \ + -u ${pg_auto_failover_user} \ + ${procname} run ${args} +} + +run_rc_command "$1" diff --git a/databases/pg_auto_failover-devel/pkg-descr b/databases/pg_auto_failover-devel/pkg-descr new file mode 100644 index 000000000000..9760fa1411ab --- /dev/null +++ b/databases/pg_auto_failover-devel/pkg-descr @@ -0,0 +1,26 @@ +pg_auto_failover is an extension and service for PostgreSQL that +monitors and manages automated failover for a Postgres cluster. It is +optimized for simplicity and correctness and supports Postgres 13 to +18. + +pg_auto_failover supports several Postgres architectures and +implements a safe automated failover for your Postgres service. It is +possible to get started with only two data nodes which will be given +the roles of primary and secondary by the monitor. + +The pg_auto_failover Monitor implements a state machine and relies on +in-core PostgreSQL facilities to deliver HA. For example, when the +secondary node is detected to be unavailable, or when its lag is too +much, then the Monitor removes it from the synchronous_standby_names +setting on the primary node. Until the secondary is back to being +monitored healthy, failover and switchover operations are not allowed, +preventing data loss. + +pg_auto_failover consists of the following parts: + +- a PostgreSQL extension named pgautofailover +- a PostgreSQL service to operate the pg_auto_failover monitor +- a pg_auto_failover keeper to operate your PostgreSQL instances, see + pg_autoctl run + +This is the development version tracking the main branch. diff --git a/databases/pg_auto_failover-devel/pkg-plist b/databases/pg_auto_failover-devel/pkg-plist new file mode 100644 index 000000000000..aea7ca0763e3 --- /dev/null +++ b/databases/pg_auto_failover-devel/pkg-plist @@ -0,0 +1,15 @@ +bin/pg_autoctl +lib/postgresql/pgautofailover.so +share/postgresql/extension/pgautofailover--1.0--1.1.sql +share/postgresql/extension/pgautofailover--1.0.sql +share/postgresql/extension/pgautofailover--1.1--1.2.sql +share/postgresql/extension/pgautofailover--1.2--1.3.sql +share/postgresql/extension/pgautofailover--1.3--1.4.sql +share/postgresql/extension/pgautofailover--1.4--1.5.sql +share/postgresql/extension/pgautofailover--1.5--1.6.sql +share/postgresql/extension/pgautofailover--1.6--2.0.sql +share/postgresql/extension/pgautofailover--2.0--2.1.sql +share/postgresql/extension/pgautofailover--2.1--2.2.sql +share/postgresql/extension/pgautofailover--2.2--dummy.sql +share/postgresql/extension/pgautofailover--2.2.sql +share/postgresql/extension/pgautofailover.control diff --git a/databases/pg_auto_failover/Makefile b/databases/pg_auto_failover/Makefile index 6f84a6023fa9..d6d48afad4ba 100644 --- a/databases/pg_auto_failover/Makefile +++ b/databases/pg_auto_failover/Makefile @@ -18,6 +18,8 @@ WANT_PGSQL= contrib server USE_GITHUB= yes GH_ACCOUNT= hapostgres +CONFLICTS= postgresql*-pg_auto_failover* + USE_RC_SUBR= pg_auto_failover CONFLICTS= postgresql*-pg_auto_failover*