Re: Hot Standby, release candidate? - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Hot Standby, release candidate?
Date
Msg-id 1260817115.1955.1523.camel@ebony
Whole thread Raw
In response to Re: Hot Standby, release candidate?  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Hot Standby, release candidate?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, 2009-12-14 at 20:32 +0200, Heikki Linnakangas wrote:

> >> * You removed this comment from KnownAssignedXidsInit:
> >>
> >> -   /*
> >> -    * XXX: We should check that we don't exceed maxKnownAssignedXids.
> >> -    * Even though the hash table might hold a few more entries than that,
> >> -    * we use fixed-size arrays of that size elsewhere and expected all
> >> -    * entries in the hash table to fit.
> >> -    */
> >>
> >> but AFAICS you didn't address the issue. It's referring to the 'xids'
> >> array in TransactionIdIsInProgress(), which KnownAssignedXidsGet() fills
> >> in without checking that it fits.
> > 
> > I have ensured that they are always the same size, by definition, so no
> > need to check.
> 
> How did you ensure that? The hash table has no hard size limit.

The hash table is in shared memory and the entry size is fixed. My
understanding was that this meant the hash table was fixed in size and
could not grow beyond the allocation. If that assumption was wrong, then
yes we could get an error. Is it? Do you know from experience, or from
code comments?

Incidentally just picked up two much easier issues in that stretch of
code. Thanks for making me look again!

-- Simon Riggs           www.2ndQuadrant.com



pgsql-hackers by date:

Previous
From: Scott Bailey
Date:
Subject: Re: Range types
Next
From: Tom Lane
Date:
Subject: Re: Streaming replication and non-blocking I/O