[pgpool-general: 7864] Re: Rejecting database mutations without a quorum
ishii at sraoss.co.jp
Mon Nov 8 20:52:33 JST 2021
>> One of the difficulties with this kind of approach is, how to decide
>> that the primary should be killed in a reliable way.
>> Suppose we have:
>> node 1: pgpool/watchdog 1, primary PostgreSQL
>> node 2: pgpool/watchdog 2, standby PostgreSQL
>> node 3: pgpool/watchdog 3, standby PostgreSQL
>> The scenario:
>> 1) Watchdog 1 lost communication to watchdog 2 and watchdog 3. So
>> watchdog 1 lost quorum.
>> 2) However communication between pgpool 1/2 and the primary is still
>> 3) Watchdog 1 decides to kill the primary and the primary goes down.
>> 4) pgpool 1/2 have to promote one of the standbys to create new primary.
> Yes, this always is the issue with communication within a cluster, or more
> specifically the loss of communication. That's why I wanted to discuss this
> here. What happens to a VIP in your scenario if watchdog 1 started with the
> VIP assigned? Will watchdog 1 drop the VIP when it losses the quorum?
> the pgpool 1 still supposed to receive queries when it can no longer be
> sure it is sending them to the correct database?
I am not sure what you mean here. It's user's responsibility to send
queries to a pgpool which does not have quorum but Pgpool-II assumes
that clients sends queries to VIP.
> In our setup, what I would ideally see is that I can configure pgpool to
> not send writes (or completely disconnect all its backends) when the
> instance is not part of a quorum. Also, it would be really great if I can
> configure a command when the watchdog status changes. That would allow me
> to implement custom behavior myself.
Maybe you misunderstand Pgpool-II's architecture. In a Pgpool-II
cluster, Pgpool-II and PostgreSQL processes are logically separated
objects. Whether Pgpool-II and PostgreSQL processes are running on a
separate host or not is irrevant to the functionality of the cluster.
On the other hand I understand your motivation. Allowing to have a
command which is called when watchdog quorum status changes might be a
SRA OSS, Inc. Japan
More information about the pgpool-general