Re: [HACKERS] SERIALIZABLE on standby servers - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: [HACKERS] SERIALIZABLE on standby servers
Date
Msg-id CAEepm=1+oBXAUckBG_KgXxbhj1pcj_rqwZBKfvfi3azvr2bwGQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] SERIALIZABLE on standby servers  (Thomas Munro <thomas.munro@enterprisedb.com>)
List pgsql-hackers
On Sat, Sep 22, 2018 at 12:28 AM Thomas Munro
<thomas.munro@enterprisedb.com> wrote:
> I'll add it to the next
> Commitfest so I know when to rebase it.

And cfbot immediately showed that this assertion in
OldSerXidSetActiveSerXmin() could fail in the isolation tests:

    Assert(!TransactionIdIsValid(oldSerXidControl->tailXid)
           || TransactionIdFollows(xid, oldSerXidControl->tailXid));

Not sure how that ever worked or if I screwed something up while
rebasing, but the quick (and possibly wrong?) solution I found was to
exclude hypothetical SERIALIABLEXACTs when scanning for the new oldest
xid:

@@ -3181,6 +3322,7 @@ SetNewSxactGlobalXmin(void)
        for (sxact = FirstPredXact(); sxact != NULL; sxact =
NextPredXact(sxact))
        {
                if (!SxactIsRolledBack(sxact)
+                       && !SxactIsHypothetical(sxact)
                        && !SxactIsCommitted(sxact)
                        && sxact != OldCommittedSxact)

Here's a version like that in the meantime so that the CI passes.  The
real solution might be to give them their own xid (right now they
"borrow" one, see PreCommit_CheckForSerializationFailure()... now that
I think about it, that must be wrong), when I have more time for this
project.

-- 
Thomas Munro
http://www.enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Size and size_t in dsa API
Next
From: Hubert Zhang
Date:
Subject: Re: Proposal for disk quota feature