On Tue, Jun 15, 2021 at 5:51 AM tsunakawa.ta...@fujitsu.com <tsunakawa.ta...@fujitsu.com> wrote: > Postgres can do that, but other implementations can not necessaily do it, I'm > afraid. But before that, the FDW interface documentation doesn't describe > anything about how to handle interrupts. Actually, odbc_fdw and possibly > other FDWs don'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 commit in the second phase of 2PC. > That's new to Postgres, isn't it? Anyway, we should respect existing > relevant specifications and (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 involves the resolver from the > beginning of 2PC processing. Honestly, I don't understand why such a "one > prepare, one commit in turn" serialization approach can be allowed in > PostgreSQL where developers pursue best performance and even tries to refrain > from adding an if statement in a hot path. As I showed and Ikeda-san said, > other implementations have each client 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