[pgpool-committers: 9777] pgpool: Enhance the stability of detach_false_primary.

Tatsuo Ishii ishii at sraoss.co.jp
Sun Mar 17 10:13:55 JST 2024


Enhance the stability of detach_false_primary.

It was possible that enabling detach_false_primary caused that all
backend nodes went down.

Suppose watchdog is enabled and there are 3 watchdog nodes pgpool0,
pgpool1 and pgpool2. If pgpool0 and pgpool1 find primary PostgreSQL
goes down due to network trouble between pgpool and PostgreSQL, they
promote a standby node. pgpool2 could find that there are two primary
nodes because the backend status at pgpool2 has not been synced with
pgpool0 and pgpool1, and pgpool2 perform detach_false_primary against
the standby, which is being promoted.

To prevent the issue, now detach_false_primary is performed only by
watchdog leader node. With this, pgpool will not see half baked
backend status and the issue described above will not happen.

Discussion: https://www.pgpool.net/pipermail/pgpool-hackers/2024-February/004432.html
([pgpool-hackers: 4431] detach_false_primary could make all nodes go down)

Branch
------
master

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=0b94cd9f0d6591e9e5d230f1d5b074297916f023

Modified Files
--------------
doc.ja/src/sgml/failover.sgml                      |   6 ++
doc/src/sgml/failover.sgml                         |  11 ++
src/streaming_replication/pool_worker_child.c      |  70 +++++++++++-
.../tests/081.detach_primary_all_down/test.sh      | 119 +++++++++++++++++++++
4 files changed, 202 insertions(+), 4 deletions(-)



More information about the pgpool-committers mailing list