I repro'ed on PG11 and PG10 STABLE but several months old.
I looked at 6d05086 but it doesn't address the core issue.

DropRelFileNodeBuffers prevents the checkpoint from writing all needed dirty 
pages for any REDO's that exist BEFORE the truncate.  If we crash after a 
checkpoint but before the physical truncate then the REDO will need to replay 
the operation against the dirty page that the Drop invalidated.

Teja Mupparti, an engineer I work with, suggested moving DropRelFileNodeBuffers 
to the bottom of smgrtruncate() after the physical truncate.  Doing that along 
with a fsync() after the truncate seems to plug the hole.


>     On November 8, 2019 at 5:39 PM Michael Paquier < mich...@paquier.xyz 
> mailto:mich...@paquier.xyz > wrote:
> 
> 
>     On Fri, Nov 08, 2019 at 12:46:51PM -0800, Daniel Wood wrote:
> 
>         > >         Is DropRelFileNodeBuffers purely for performance or would 
> there be
> >         any correctness problems if not done.
> > 
> >     >     On which version did you find that? Only HEAD or did you use a
>     version on a stable branch? There has been some work done in this
>     area lately as of 6d05086.
>     --
>     Michael
> 

Reply via email to