Re: [HACKERS] logical replication busy-waiting on a lock - Mailing list pgsql-hackers

From Petr Jelinek
Subject Re: [HACKERS] logical replication busy-waiting on a lock
Date
Msg-id b38ee88b-45ad-19c8-b261-8eac5ae77e89@2ndquadrant.com
Whole thread Raw
In response to Re: [HACKERS] logical replication busy-waiting on a lock  (Andres Freund <andres@anarazel.de>)
Responses Re: [HACKERS] logical replication busy-waiting on a lock  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On 29/05/17 21:28, Andres Freund wrote:
> 
> On May 29, 2017 12:25:35 PM PDT, Petr Jelinek <petr.jelinek@2ndquadrant.com> wrote:
>>
>> Looking at the code more, the xid is only used as parameter for
>> SnapBuildBuildSnapshot() which never does anything with that parameter,
>> I wonder if it's really needed then.
> 
> Not at a computer, but by memory that'll trigger the snapshot export routine to include it.  Import in turn requires
thexid to check if the source is still alive.  But there's better ways, e.g. using the virtual xactid.
 
> 

It does, and while that's unfortunate the logical replication does not
actually export the snapshots. It uses the USE_SNAPSHOT option where the
snapshot is just installed into current transaction but not exported. So
not calling the GetTopTransactionId() would solve it at least for that
in-core use-case. I don't see any bad side effects from doing so yet, so
it might be good enough solution for PG10.

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



pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: Re: [HACKERS] psql: Activate pager only for height, not width
Next
From: Andres Freund
Date:
Subject: Re: [HACKERS] logical replication busy-waiting on a lock