Re: Is this a problem in GenericXLogFinish()?

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Is this a problem in GenericXLogFinish()?
Дата
Msg-id 08b4f1f7dcf321d38373f06acc65a8d62cc2f017.camel@j-davis.com
обсуждение исходный текст
Ответ на Re: Is this a problem in GenericXLogFinish()?  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Is this a problem in GenericXLogFinish()?
Список pgsql-hackers
On Wed, 2023-09-27 at 10:36 -0400, Robert Haas wrote:
> On Tue, Sep 26, 2023 at 9:36 PM Jeff Davis <pgsql@j-davis.com> wrote:
> > That site is pretty trivial to fix, but there are also a couple
> > places
> > in hash.c and hashovfl.c that are registering a clean page and it's
> > not
> > clear to me exactly what's going on.
>
> Huh, I wonder if that's just a bug. Do you know where exactly?

hashovfl.c:665 and hash.c:831

In both cases it's registering the bucket_buf, and has a comment like:

 /*
  * bucket buffer needs to be registered to ensure that we can
  * acquire a cleanup lock on it during replay.
  */

And various redo routines have comments like:

 /*
  * Ensure we have a cleanup lock on primary bucket page before we
start
  * with the actual replay operation.  This is to ensure that neither a
  * scan can start nor a scan can be already-in-progress during the
replay
  * of this operation.  If we allow scans during this operation, then
they
  * can miss some records or show the same record multiple times.
  */

So it looks like it's intentionally registering a clean buffer so that
it can take a cleanup lock for reasons other than cleaning (or even
modiying) the page. I would think that there's a better way of
accomplishing that goal, so perhaps we can fix that?

Regards,
    Jeff Davis




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: pg_stat_get_activity(): integer overflow due to (int) * (int) for MemoryContextAllocHuge()
Следующее
От: Robert Haas
Дата:
Сообщение: Re: SLRUs in the main buffer pool - Page Header definitions