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

Tatsuo Ishii ishii at sraoss.co.jp
Sat Mar 16 22:28:28 JST 2024


Enhance the stability of detach_false_primary.

It was possible that enabling detach_false_primary caused that all
backend node 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 situation, now detach_false_primary is performed by only
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=c5b25883d21a180ec54a2fea9de67d5da1367464

Modified Files
--------------
doc.ja/src/sgml/failover.sgml                      |   6 ++
doc/src/sgml/failover.sgml                         |  11 ++
src/protocol/pool_proto_modules.c                  |  16 ++-
.../tests/081.detach_primary_all_down/test.sh      | 119 +++++++++++++++++++++
4 files changed, 151 insertions(+), 1 deletion(-)



More information about the pgpool-committers mailing list