synchronized standby: committed local and waiting for remote ack

From: qihua wu <staywithpin(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: synchronized standby: committed local and waiting for remote ack
Date: 2023-01-14 03:16:56
Message-ID: CAPoYtoJ5wCG2wE79gbqkou0EFpErpyJ=qfSzs03D1o5KXpnWjw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

We are using patroni to set up 1 primary and 5 slaves, and using ANY 2 (*)
to commit a transaction if any 2 standbys receive the WAL. If there is a
network partitioning between the primary and the slave, then commit will
hang from user perspective, but the commit is actually done locally, just
waiting for remote ack which is not possible because of network split. And
if patroni promotes a slave to primary, then we will lost data. Do you
think of a different design: first wait for remote ACK, and then commit
locally, this will only failed if local commit failed, but local commit
fail is much rarer than network partitioning in a cloud env: it will only
fail when IO issue or disk is full. So I am thinking of the possibility of
switch the order: first wait for remote ACK, and then commit locally.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2023-01-14 05:20:51 Re: Intervals and ISO 8601 duration
Previous Message Tatsuo Ishii 2023-01-14 02:16:14 Re: Intervals and ISO 8601 duration