[pgpool-committers: 3375] pgpool: Fix for 218: Inconsistent status of Postgresql nodes in pgPool

Muhammad Usama m.usama at gmail.com
Tue Aug 2 23:49:34 JST 2016


Fix for 218: Inconsistent status of Postgresql nodes in pgPool instances
after restart. Watchdog not syncing status.

Currently at the pgpool-II startup, The status of each configured backend node
is loaded from the backend status file or otherwise initialized by querying the
backend nodes. This technique works fine in stand alone mode and also with
the watchdog enabled as long as the status of backend nodes remains consistent
until all pgpool-II nodes got up and running.
But since pgpool-II does not sync the backend node status from the
watchdog cluster at startup time, so in some cases the pgpool-II nodes
participating in the watchdog cluster may get a different status for the same
backend, especially if the pgpool-II nodes part of the watchdog cluster starts
at different times and between that time an unavailable backend PostgreSQL node
had become available again.

So to solve this, the commit implements the new startup procedure for the
standby pgpool-II, And now the standby pgpool-II will load the backend status of
all configured PostgreSQL nodes from the watchdog master/coordinator node
at the time of startup.

Branch
------
V3_5_STABLE

Details
-------
http://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=72573ca6d45ca2fc985a06936c0c52808fe78ef1

Modified Files
--------------
src/include/watchdog/wd_ipc_commands.h |   2 +
src/include/watchdog/wd_ipc_defines.h  |   4 +-
src/include/watchdog/wd_json_data.h    |  19 ++++
src/main/pgpool_main.c                 |  87 +++++++++++++++++-
src/watchdog/watchdog.c                | 155 +++++++++++++++++++++++++++++++--
src/watchdog/wd_commands.c             |  96 ++++++++++++++++++--
src/watchdog/wd_json_data.c            | 130 +++++++++++++++++++++++++++
7 files changed, 470 insertions(+), 23 deletions(-)



More information about the pgpool-committers mailing list