Re: Disallow cancellation of waiting for synchronous replication

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Cc: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, Jeff Davis <pgsql(at)j-davis(dot)com>, Marco Slot <marco(at)citusdata(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, dim(at)tapoueh(dot)org, milyutinma(at)gmail(dot)com
Subject: Re: Disallow cancellation of waiting for synchronous replication
Date: 2021-04-23 09:30:28
Message-ID: CAJ7c6TMewCK3ObDaa=oLXkcc+Y=6nce045JVGOHAWkUoW-6Dew@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

> >> After using a patch for a while it became obvious that PANICing during termination is not a good idea. Even when we wait for synchronous replication. It generates undesired coredumps.
> >> I think in presence of SIGTERM it's reasonable to say that we cannot protect user anymore.
> >> PFA v3.

This patch, although solving a concrete and important problem, looks
more like a quick workaround than an appropriate solution. Or is it
just me?

Ideally, the transaction should be committed only after getting a
reply from the standby. If the user cancels the transaction, it
doesn't get committed anywhere. This is what people into distributed
systems would expect unless stated otherwise, at least. Although I
realize how complicated it is to implement, especially considering all
the possible corner cases (netsplit right after getting a reply, etc).
Maybe we could come up with a less than ideal, but still sound and
easy-to-understand model, which, as soon as you learned it, doesn't
bring unexpected surprises to the user.

I believe at this point it's important to agree if the community is
ready to accept a patch as is to make existing users suffer less and
iterate afterward. Or we choose not to do it and to come up with
another idea. Personally, I don't have any better ideas, thus maybe
accepting Andrey's patch would be the lesser of two evils.

--
Best regards,
Aleksander Alekseev

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2021-04-23 09:33:09 Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY
Previous Message Amit Kapila 2021-04-23 09:15:27 Re: Replication slot stats misgivings