Re: Re: [COMMITTERS] pgsql: Adjust OLDSERXID_MAX_PAGE based on BLCKSZ.

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, rhaas(at)postgresql(dot)org
Subject: Re: Re: [COMMITTERS] pgsql: Adjust OLDSERXID_MAX_PAGE based on BLCKSZ.
Date: 2011-07-08 16:01:16
Message-ID: CA+Tgmoa6Kjir3Dk=hRCr1aL4X13=vww1mC8LHh1bZMHagWRn6g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 8, 2011 at 11:57 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
>> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> At this point I think the actual choice we'd have is to abandon
>>> beta3 and try again next week with a beta4.  I'm trying to figure
>>> out whether this bug is serious enough to warrant that, but it's
>>> not clear to me.
>
>> I changed the definition to this:
>
>> #define OLDSERXID_MAX_PAGE (-1)
>
>> That caused my compiler to report the following warnings:
>
>> predicate.c: In function *OldSerXidAdd*:
>> predicate.c:828: warning: division by zero
>> predicate.c:848: warning: division by zero
>> predicate.c: In function *OldSerXidGetMinConflictCommitSeqNo*:
>> predicate.c:958: warning: division by zero
>> predicate.c: In function *CheckPointPredicate*:
>> predicate.c:1038: warning: division by zero
>
>> It's hard to imagine that any compiler would evaluate it to -1
>> instead of the value it's had all along (including beta2) and not
>> generate these warnings, too.
>
> The value of OLDSERXID_ENTRIESPERPAGE includes a sizeof() call, so
> every compiler I've ever heard of is going to consider it an unsigned
> value, so we should be getting an unsigned comparison in the Min().
> So I think you are right that OLDSERXID_MAX_PAGE should end up with
> its old value.  Still, it's a bit nervous-making to have such problems
> popping up with a patch that went in at the eleventh hour --- and it
> was about the least of the last-minute patches for SSI, too.  So
> color me uncomfortable ...

I agree.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian Pflug 2011-07-08 16:08:16 Re: Latch implementation that wakes on postmaster death on both win32 and Unix
Previous Message Tom Lane 2011-07-08 15:57:15 Re: Re: [COMMITTERS] pgsql: Adjust OLDSERXID_MAX_PAGE based on BLCKSZ.