Re: [COMMITTERS] pgsql: contrib/amcheck needs RecentGlobalXmin to be PGDLLIMPORT'ified. - Mailing list pgsql-committers

From Peter Geoghegan
Subject Re: [COMMITTERS] pgsql: contrib/amcheck needs RecentGlobalXmin to be PGDLLIMPORT'ified.
Date
Msg-id CAH2-WznBwJh0vVMW7ZF5M-PGVuxZeEj-oe3LjW2fmXaf-6SaNg@mail.gmail.com
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: contrib/amcheck needs RecentGlobalXmin to bePGDLLIMPORT'ified.  (Andres Freund <andres@anarazel.de>)
List pgsql-committers
On Fri, Mar 10, 2017 at 11:47 AM, Andres Freund <andres@anarazel.de> wrote:
>>       Assert(TransactionIdIsValid(RecentGlobalXmin));
>>
>> I agree: that is just about utterly useless.
>
> Well, it mirrors an existing Assert, that'd be hit when doing normal
> index lookups.  But I agree that a bug around this is exceedingly
> unlikely at this point, so there's no coverage value in it.

I was in favor of just removing the assertion myself, given the
PGDLLIMPORT issue, but FWIW I am generally in favor of documenting
assertions like this. I suppose that this assertion is less likely to
ever break than most other assertions, but presumably no code ever
gets committed without somebody being pretty confident that any
assertions it happens to have will never fail to hold. It doesn't seem
productive to worry about whether or not any trivial assertions are
pulling their weight. They're justified as documentation. If the
assertion ever does fail, preventing someone from pushing buggy code,
then so much the better.

--
Peter Geoghegan


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: [COMMITTERS] pgsql: pg_dump: Fix dumping of publications
Next
From: Tom Lane
Date:
Subject: [COMMITTERS] pgsql: Improve postmaster's logging of listen socket creation.