Re: MarkBufferDirtyHint() and LSN update

From: Antonin Houska <ah(at)cybertec(dot)at>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: MarkBufferDirtyHint() and LSN update
Date: 2019-11-01 17:51:26
Message-ID: 94901.1572630686@antos
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

> On Wed, Oct 30, 2019 at 9:43 AM Antonin Houska <ah(at)cybertec(dot)at> wrote:
> > 5. In the first session, FlushBuffer()->TerminateBufferIO() will not clear
> > BM_DIRTY because MarkBufferDirtyHint() has eventually set
> > BM_JUST_DIRTIED. Thus the hint bit change itself will be written by the next
> > call of FlushBuffer(). However page LSN is hasn't been updated so the
> > requirement that WAL must be flushed first is not met.
>
> This part confuses me. Are you saying that MarkBufferDirtyHint() can
> set BM_JUST_DIRTIED without setting BM_DIRTY?

No, I'm saying that MarkBufferDirtyHint() leaves BM_DIRTY set, as
expected. However, if things happen in the order I described, then LSN
returned by XLogSaveBufferForHint() is not assigned to the page.

--
Antonin Houska
Web: https://www.cybertec-postgresql.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2019-11-01 17:57:29 Re: ssl passphrase callback
Previous Message Fabien COELHO 2019-11-01 17:41:52 Re: fe-utils - share query cancellation code