Re: Hot standby, recent changes

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Hot standby, recent changes
Date: 2009-12-06 16:18:55
Message-ID: 1260116335.13774.45452.camel@ebony
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 2009-12-06 at 10:51 +0000, Simon Riggs wrote:

> > 5. You removed this comment from KnownAssignedXidsAdd:
> >
> > - /*
> > - * 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.
> > - */
> >
> > I think the issue still exists. The comment refers to
> > KnownAssignedXidsGet, which takes as an argument an array that has to be
> > large enough to hold all entries in the known-assigned hash table. If
> > there's more entries than expected in the hash table,
> > KnownAssignedXidsGet will overrun the array. Perhaps
> > KnownAssignedXidsGet should return a palloc'd array instead or
> > something, but I don't think it's fine as it is.
>
> Same issue perhaps, different place.

Well, its not same issue. One was about entering things into a shared
memory hash table, one is about reading values into an locally malloc'd
array. The array is sized as the max size of KnownAssignedXids, so there
is no danger that there would ever be an overrun.

One caller does not set the max size explicitly, so I will add a
comment/code changes to make that clearer.

--
Simon Riggs www.2ndQuadrant.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-12-06 16:51:20 Re: Error message translation, with variable reason text
Previous Message Simon Riggs 2009-12-06 16:09:18 Re: Allowing DML RULEs that produce Read Only actions during RO xacts