Re: Small SSI issues

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Robert Haas" <robertmhaas(at)gmail(dot)com>
Cc: <drkp(at)csail(dot)mit(dot)edu>,<heikki(dot)linnakangas(at)enterprisedb(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Small SSI issues
Date: 2011-07-05 16:03:26
Message-ID: 4E12EF7E020000250003EFB2@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> Well, as long as we can verify that OLDSERXID_MAX_PAGE has the
> same value for BLCKSZ=8K before and after this patch, I don't see
> any real downside to applying it. If, hypothetically, it's buggy,
> it's only going to break things for non-default block sizes which
> are, by your description, not correct right now anyway.

Outside of a code comment, the entire patch consists of replacing
the definition of the OLDSERXID_MAX_PAGE macro. The old definition
is:

(SLRU_PAGES_PER_SEGMENT * 0x10000 - 1)

SLRU_PAGES_PER_SEGMENT is define to be 32. So this is:

(32 * 0x10000) - 1 = 2097151

The new definition is the min of the old one and a value based on
BLCKSZ:

(MaxTransactionId + 1) / OLDSERXID_ENTRIESPERPAGE - 1)

Where "entries per page" is BLCKSZ / sizeof(uint64).

For an 8K BLCKSZ this is:

((0xffffffff + 1) / 1024) - 1 = 4194303

So the macro is guaranteed to have the same value as it currently
does for BLCKSZ of 16KB or lower.

-Kevin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2011-07-05 16:03:40 Re: capturing regression test core dump
Previous Message Pavel Golub 2011-07-05 16:02:13 Re: [HACKERS] COPY .... WITH (FORMAT binary) causes syntax error at or near "binary"