Re: pgsql: Merge the various forms of transaction commit & abort records. - Mailing list pgsql-committers

From Andres Freund
Subject Re: pgsql: Merge the various forms of transaction commit & abort records.
Date
Msg-id 20150323145606.GB15229@alap3.anarazel.de
Whole thread Raw
In response to Re: pgsql: Merge the various forms of transaction commit & abort records.  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-committers
On 2015-03-23 13:04:09 +0900, Michael Paquier wrote:
> On Mon, Mar 16, 2015 at 1:38 AM, Andres Freund <andres@anarazel.de> wrote:
> > Merge the various forms of transaction commit & abort records.
>
> Coverity is complaining about the following block of code:
> +       xact_info = XLogRecGetInfo(record) & XLOG_XACT_COMMIT;
> +
> +       if (xact_info != XLOG_XACT_COMMIT &&
> +               xact_info != XLOG_XACT_COMMIT_PREPARED)
>                 return false;
>
> Instead of XLOG_XACT_COMMIT, shouldn't this function use XLOG_XACT_OPMASK?

That's a neat catch (by you and coverity). I wish we had automated test
infrastructure for this stuff (hint hint ;)). It's hard to remember to
test both normal and prepared xacts in all of the different scenarios.

Greetings,

Andres Freund

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


pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: Remove ill-advised pre-check for DSM segment exhaustion.
Next
From: Andres Freund
Date:
Subject: pgsql: Fix copy & paste error in 4f1b890b137.