Re: Transactions involving multiple postgres foreign servers, take 2

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Transactions involving multiple postgres foreign servers, take 2
Дата
Msg-id CA+TgmoapYrULdCtRByft5mz+MnhYz=MoM5iHNFWo=cJ-KOZPrg@mail.gmail.com
обсуждение исходный текст
Ответ на RE: Transactions involving multiple postgres foreign servers, take 2  ("tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>)
Ответы RE: Transactions involving multiple postgres foreign servers, take 2  ("tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>)
Список pgsql-hackers
On Tue, Jun 15, 2021 at 5:51 AM tsunakawa.takay@fujitsu.com
<tsunakawa.takay@fujitsu.com> wrote:
> Postgres can do that, but other implementations can not necessaily do it, I'm afraid.  But before that, the FDW
interfacedocumentation doesn't describe anything about how to handle interrupts.  Actually, odbc_fdw and possibly other
FDWsdon't respond to interrupts. 

Well, I'd consider that a bug.

> What we're talking here is mainly whether commit should return success or failure when some participants failed to
commitin the second phase of 2PC.  That's new to Postgres, isn't it?  Anyway, we should respect existing relevant
specificationsand (well-known) implementations before we conclude that we have to devise our own behavior. 

Sure ... but we can only decide to do things that the implementation
can support, and running code that might fail after we've committed
locally isn't one of them.

> We talked about that, and unfortunately, I haven't seen a good and feasible idea to enhance the current approach that
involvesthe resolver from the beginning of 2PC processing.  Honestly, I don't understand why such a "one prepare, one
commitin turn" serialization approach can be allowed in PostgreSQL where developers pursue best performance and even
triesto refrain from adding an if statement in a hot path.  As I showed and Ikeda-san said, other implementations have
eachclient session send prepare and commit requests.  That's a natural way to achieve reasonable concurrency and
performance.

I think your comparison here is quite unfair. We work hard to add
overhead in hot paths where it might cost, but the FDW case involves a
network round-trip anyway, so the cost of an if-statement would surely
be insignificant. I feel like you want to assume without any evidence
that a local resolver can never be quick enough, even thought the cost
of IPC between local processes shouldn't be that high compared to a
network round trip. But you also want to suppose that we can run code
that might fail late in the commit process even though there is lots
of evidence that this will cause problems, starting with the code
comments that clearly say so.

--
Robert Haas
EDB: http://www.enterprisedb.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: snapshot too old issues, first around wraparound and then more.