PG_AUTOCTL_WATCH(1)
π pg_autoctl watch β the auto-updating dashboard era π
okay bestie, buckle up, this is pg_autoctl watch, part of pg_auto_failover (the pg_autoctl command suite, manual section 1). it's literally a dashboard that refreshes itself, no cap. β¨
π NAME π
pg_autoctl watch β pg_autoctl watch
pg_autoctl watch β displays an auto-updating dashboard π
π SYNOPSIS π
this command outputs the events that the pg_auto_failover events records about state changes of the pg_auto_failover nodes managed by the monitor:
usage: pg_autoctl watch [ --pgdata --formation --group ]
--pgdata path to data directory
--monitor show the monitor uri
--formation formation to query, defaults to 'default'
--group group to query formation, defaults to all
--json output data in the JSON format
π OPTIONS π
--pgdataβ where the Postgres node being managed locally lives. defaults to the environment variablePGDATA. and listen: use--monitorif you wanna connect to a monitor from literally anywhere, instead of using the monitor URI that a local Postgres node managed withpg_autoctlis already using. π«Ά--monitorβ the Postgres URI used to connect to the monitor. it must use theautoctl_nodeusername and target thepg_auto_failoverdatabase name, no exceptions bestie. also you can show the Postgres URI from the monitor node using the commandpg_autoctl show uri. π--formationβ lists the events recorded for nodes in the given formation. defaults todefault.--groupβ limits the output to a single group in the formation. defaults to including all groups registered in the target formation.
πΈ ENVIRONMENT πΈ
PGDATAβ Postgres directory location. can be used instead of the--pgdataoption. πPG_AUTOCTL_MONITORβ Postgres URI to connect to the monitor node, can be used instead of the--monitoroption.XDG_CONFIG_HOMEβ thepg_autoctlcommand stores its configuration files in the standard placeXDG_CONFIG_HOME. see the XDG Base Directory Specification. πXDG_DATA_HOMEβ thepg_autoctlcommand stores its internal states files in the standard placeXDG_DATA_HOME, which defaults to~/.local/share. see the XDG Base Directory Specification. π
β¨ DESCRIPTION β¨
the pg_autoctl watch output is divided into 3 sections, and each one is doing its own little thing. let's get into it. π¦
π§ section one: the header line
the first section is a single header line. it includes the name of the currently selected formation, the formation replication setting Number Sync Standbys, and then in the right most position, the current time. β°
π section two: one line per node
the second section displays one line per node, and each line contains a list of columns that describe the current state for that node. this list can include the following columns β and which columns actually show up depends on your terminal window size. this choice is dynamic and changes if your terminal window size changes. so yes, resize your terminal and watch it glow up in real time. πβ¨
- Name β name of the node.
- Node, or Id β node information. when the formation has a single group (group zero), then this column only contains the
nodeId.
only Citus formations allow several groups. when using a Citus formation the Node column contains the groupId and the nodeId, separated by a colon, such as 0:1 for the first coordinator node.
- Last Report, or Report β time interval between now and the last known time when a node has reported to the monitor, using the
node_activeprotocol.
this value is expected to stay under 2s or abouts, and is known to increment when either the pg_autoctl run service is not running, or when there is a network split. π
- Last Check, or Check β time interval between now and the last known time when the monitor could connect to a node's Postgres instance, via its health check mechanism.
this value is known to increment when either the Postgres service is not running on the target node, when there is a network split, or when the internal machinery (the health check worker background process) implements jitter.
- Host:Port β hostname and port number used to connect to the node.
- TLI: LSN β timeline identifier (TLI) and Postgres Log Sequence Number (LSN).
the LSN is the current position in the Postgres WAL stream. this is a hexadecimal number. see pg_lsn for more information.
the current timeline is incremented each time a failover happens, or when doing Point In Time Recovery. a node can only reach the secondary state when it is on the same timeline as its primary node. π
- Connection β this output field contains two bits of information. first, the Postgres connection type that the node provides, either
read-writeorread-only. then the mark!is added when the monitor has failed to connect to this node, and?when the monitor didn't connect to the node yet. - Reported State β the current FSM state as reported to the monitor by the
pg_autoctlprocess running on the Postgres node. - Assigned State β the assigned FSM state on the monitor. when the assigned state is not the same as the reported start, then the
pg_autoctlprocess running on the Postgres node might have not retrieved the assigned state yet, or might still be implementing the FSM transition from the current state to the assigned state. π
π section three: the events feed
the third and last section lists the most recent events that the monitor has registered. the more recent event is found at the bottom of the screen. π
ok quitting time: to quit the command hit either the F1 key or the q key. that's it. that's the whole exit strategy. π
π AUTHOR π
Microsoft
β COPYRIGHT β
Copyright (c) Microsoft Corporation. All rights reserved.
and that's the whole vibe check, bestie β this was pg_autoctl watch from pg_auto_failover version 2.1, dated Jan 18, 2025, manual section 1. go forth and watch those nodes slay. ππβ¨
π¦ where this page comes from
- fedora 43: pg_auto_failover 2.1-6.fc42 Β· Apache-1.0
- fedora 44: pg_auto_failover 2.1-6.fc42 Β· Apache-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms