Re: [HACKERS] Potential hot-standby bug around xacts committed but in xl_running_xacts - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: [HACKERS] Potential hot-standby bug around xacts committed but in xl_running_xacts
Date
Msg-id CAMsr+YEjygnXYCpJeWO4xQVHg0qWoKTPaQiAqto4Xy=odAK5xw@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Potential hot-standby bug around xacts committed but in xl_running_xacts  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
On 2 May 2017 at 13:12, Simon Riggs <simon@2ndquadrant.com> wrote:

> What I suggest is that with logical decoding in mind we do this
> 1. Inject a new record XLOG_SNAPSHOT_START at the start of
> LogStandbySnapshot(). We start logical decoding from there.
> 2. Record any transactions that end
> 3. Now the full XLOG_RUNNING_XACTS record arrives. We apply all xacts
> that are seen as running, minus any ended between 1 and 3
>
> This avoids the problems for the race but without holding locks while
> we log XLOG_RUNNING_XACTS, something that was considered painful for
> Hot Standby.

Sounds like a sensible solution to me. It avoids the need for a rather
undesirable interlock between xlog and shmem commit.

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



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: [HACKERS] CTE inlining
Next
From: Amit Langote
Date:
Subject: [HACKERS] multi-column range partition constraint