Re: [HACKERS] SERIALIZABLE on standby servers

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: [HACKERS] SERIALIZABLE on standby servers
Дата
Msg-id CAEepm=1+oBXAUckBG_KgXxbhj1pcj_rqwZBKfvfi3azvr2bwGQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] SERIALIZABLE on standby servers  (Thomas Munro <thomas.munro@enterprisedb.com>)
Список 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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: Size and size_t in dsa API
Следующее
От: Hubert Zhang
Дата:
Сообщение: Re: Proposal for disk quota feature