Re: [HACKERS] logical decoding of two-phase transactions - Mailing list pgsql-hackers

From Petr Jelinek
Subject Re: [HACKERS] logical decoding of two-phase transactions
Date
Msg-id 47a3ab17-1a65-c747-1156-fb0c0a570204@2ndquadrant.com
Whole thread Raw
In response to Re: [HACKERS] logical decoding of two-phase transactions  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On 30/03/18 19:36, Andres Freund wrote:
> 
> 
> On March 30, 2018 10:27:18 AM PDT, Petr Jelinek <petr.jelinek@2ndquadrant.com> wrote:
>> . Locking
>> around plugin callbacks can hold he lock for longer periods of time
>> since plugins usually end up writing to network. I think for most
>> use-cases of 2PC decoding the latter is more useful as plugin should be
>> connected to some kind transaction management solution. Also the time
>> should be bounded by things like wal_sender_timeout (or
>> statement_timeout for SQL variant of decoding).
> 
> Quick thought: Should be simple to release lock when interacting with network. Could also have abort signal lockers.
> 

I thought about that as well, but then we need to change API of the
write functions of logical decoding to return info about transaction
being aborted in mean time so that plugin can abort. Seems bit ugly that
those should know about it. Alternatively we would have to disallow
multiple writes from single plugin callback. Otherwise abort can happen
during the network interaction without plugin noticing.

-- 
  Petr Jelinek                  http://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services


pgsql-hackers by date:

Previous
From: "Bossart, Nathan"
Date:
Subject: Re: BUG #14941: Vacuum crashes
Next
From: Andres Freund
Date:
Subject: Re: [HACKERS] logical decoding of two-phase transactions