hapostgres / pg_auto_failover

Postgres extension and service for automated failover and high-availability
Other
1.1k stars 115 forks source link

pg_autoctl.state of Standby site is removed accidentally #994

Open curtis18 opened 1 year ago

curtis18 commented 1 year ago

The state of node_2 under .local/share/pg_autoctl/u01/pgdata/13/data/pg_autoctl.state is removed accidentally. Hence, the postgresql of node_2 cannot be started after running "sudo systemctl restart pgautofailover", is there any way to fix let node_2 become read-only with connection again? Thank you.

Here has more information

pg_autoctl show state Name | Node | Host:Port | TLI: LSN | Connection | Reported State | Assigned State -------+-------+--------------+------------------+--------------+---------------------+-------------------- node_1 | 1 | pabdb1s:5432 | 13: 1B/84E686C0 | read-write | wait_primary | wait_primary node_2 | 2 | pabdb1p:5432 | 13: 1B/7C774000 | read-only ! | secondary | catchingup

pg_autoctl show settings Context | Name | Setting | Value ----------+---------+---------------------------+------ formation | default | number_sync_standbys | 0 primary | node_1 | synchronous_standby_names | '' node | node_1 | candidate priority | 0 node | node_2 | candidate priority | 0 node | node_1 | replication quorum | true node | node_2 | replication quorum | true

pg_autoctl --version pg_autoctl version 1.6.3 pg_autoctl extension version 1.6 compiled with PostgreSQL 13.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit compatible with Postgres 10, 11, 12, 13, and 14