Re: Disallow cancellation of waiting for synchronous replication

From: Maksim Milyutin <milyutinma(at)gmail(dot)com>
To: Marco Slot <marco(at)citusdata(dot)com>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, dim(at)tapoueh(dot)org
Subject: Re: Disallow cancellation of waiting for synchronous replication
Date: 2019-12-25 10:28:39
Message-ID: 658c420e-9899-5c24-87b0-d34ba81e17a7@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 21.12.2019 13:34, Marco Slot wrote:

> I do agree with the general sentiment that terminating the connection
> is preferable over sending a response to the client (except when
> synchronous replication was already disabled).

But in this case locally committed data becomes visible to new incoming
transactions that is bad side-effect of this issue. Under failover those
changes potentially undo.

> Synchronous replication
> does not guarantee that a committed write is actually on any replica,
> but it does in general guarantee that a commit has been replicated
> before sending a response to the client. That's arguably more
> important because the rest of what the application might depend on the
> transaction completing and replicating successfully. I don't know of
> cases other than cancellation in which a response is sent to the
> client without replication when synchronous replication is enabled.

Yes, at query canceling (e.g. by timeout from client driver) client
receives response about completed transaction (though with warning which
not all client drivers can handle properly) and the guarantee about
successfully replicated transaction *violates*.

--
Best regards,
Maksim Milyutin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Borodin 2019-12-25 10:45:23 Re: Disallow cancellation of waiting for synchronous replication
Previous Message Maksim Milyutin 2019-12-25 09:34:22 Re: Disallow cancellation of waiting for synchronous replication