Re: Re: [COMMITTERS] pgsql: Adjust OLDSERXID_MAX_PAGE based on BLCKSZ. - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Re: [COMMITTERS] pgsql: Adjust OLDSERXID_MAX_PAGE based on BLCKSZ.
Date
Msg-id 4E16FED0.5010405@enterprisedb.com
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Adjust OLDSERXID_MAX_PAGE based on BLCKSZ.  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: Re: [COMMITTERS] pgsql: Adjust OLDSERXID_MAX_PAGE based on BLCKSZ.
Re: Re: [COMMITTERS] pgsql: Adjust OLDSERXID_MAX_PAGE based on BLCKSZ.
List pgsql-hackers
On 08.07.2011 15:22, Kevin Grittner wrote:
> Heikki Linnakangas  wrote:
>
>> I'm getting a bunch of warnings on Windows related to this:
>
>>> .\src\backend\storage\lmgr\predicate.c(768): warning C4307: '+' :
>>>     integral constant overflow
>
> The part of the expression which is probably causing this:
>
>    (MaxTransactionId + 1) / OLDSERXID_ENTRIESPERPAGE - 1
>
> Which I fear may not be getting into overflow which will not do the
> right thing even where there is no warning.  :-(
>
> Would it be safe to assume that integer division would do the right
> thing if we drop both of the "off by one" adjustments and use?:
>
>    MaxTransactionId / OLDSERXID_ENTRIESPERPAGE

Hmm, that seems more correct to me anyway. We are trying to calculate 
which page xid MaxTransactionId would be stored on, if the SLRU didn't 
have a size limit. You calculate that with simply MaxTransactionId / 
OLDSERXID_ENTRIESPERPAGE.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Latch implementation that wakes on postmaster death on both win32 and Unix
Next
From: Josh Kupershmidt
Date:
Subject: Re: patch: Allow \dd to show constraint comments