Re: [Patch] Optimize dropping of relation buffers using dlist - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: [Patch] Optimize dropping of relation buffers using dlist
Date
Msg-id CA+hUKGLxeLxXGG0RAEasZAh_QKzXPshV6i--dKcPtr6k5dCf0g@mail.gmail.com
Whole thread Raw
In response to Re: [Patch] Optimize dropping of relation buffers using dlist  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List pgsql-hackers
On Thu, Oct 22, 2020 at 9:50 PM Kyotaro Horiguchi
<horikyota.ntt@gmail.com> wrote:
> By the way, heap scan finds the size of target relation using
> smgrnblocks().  I'm not sure why we don't miss recently-extended pages
> on a heap-scan?  It seems to be possible that concurrent checkpoint
> fsyncs relation files inbetween the extension and scanning and the
> scanning gets smaller size than it really is.

Yeah.  That's a narrow window: fsync() returns an error after the file
shrinks and we immediately panic.  A version with a wider window: the
kernel tries to write in the background, gets an I/O error, shrinks
the file, but we don't know this and we continue running until the
next checkpoint calls fsync(), sees the error and panics.  Seq scans
between those two events fail to see recently committed data at the
end of the table.



pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: Enumize logical replication message actions
Next
From: John Naylor
Date:
Subject: Re: speed up unicode decomposition and recomposition