[pgpool-general: 3933] Re: "replication" mode inconsistencies

Chris Pacejo cpacejo at clearskydata.com
Fri Aug 7 01:16:56 JST 2015

On Thu, Aug 6, 2015 at 5:48 AM, Jose Baez <pepote at gmail.com> wrote:
> One idea to make Pgpool not depend on any status file....
> Could pgpool2 check/compare the last query's timestamp saved in the
> postgresql log file of both nodes?

That only works so long as both nodes are reachable.  If only the
stale node is reachable, and we have no other state, how are we to
know it's stale?

I've done some more thinking on this, and I think the solution is
simply *not* to record pgpool_status when *all* nodes are down (i.e.
only record it when at least one node is up).  So pgpool_status will
always reflect the last set of nodes to which any data was written.
Upon restart, if the up-to-date (previously "up") node is in fact down
(regardless of whether the stale ("down") node is back up), pgpool
will detect this in its health check and will fail; if the up-to-date
(previously "up") node is back up, then pgpool will commence using it.

More information about the pgpool-general mailing list