autofailover
autofailover · C extension exposing autofailover functions for role and WAL status checks, promotion, and synchronous replication setting changes.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100320 | autofailover | autofailover | 1.0 | ADMIN | Unknown | C |
Usage
Sources:
autofailover is an experimental C extension that exposes PostgreSQL role/WAL state and can directly promote a standby or change synchronous-replication settings. It uses private server internals, so it must be built and tested against the exact PostgreSQL release; it is not a complete failover controller.
Inspect State
autofailover_execute(cmd, last_role) returns role, syncrep, sync_state, lsn, and walconn. The implementation recognizes status, info, promote, syncrep, and unsyncrep; last_role is accepted but not used for validation.
Operational Boundaries
promote writes PostgreSQL’s promote signal and signals the postmaster. syncrep and unsyncrep execute ALTER SYSTEM, set synchronous_standby_names to * or an empty value, and reload the configuration. These actions affect the entire cluster and do not provide fencing, quorum, leader election, split-brain prevention, or rollback.
Both installed functions are SECURITY DEFINER, and test_udf() only emits synthetic debug rows. Revoke access from untrusted roles and do not expose either function through application connections:
Use the status operation only as a low-level probe. Before considering any mutating command, validate the exact PostgreSQL ABI in an isolated cluster and supply external health checks, fencing, durable orchestration, and recovery procedures.