Re: 'Invalid lp' during heap_xlog_delete - Mailing list pgsql-hackers

From Daniel Wood
Subject Re: 'Invalid lp' during heap_xlog_delete
Date
Msg-id 875232803.252469.1573267449176@connect.xfinity.com
Whole thread Raw
In response to Re: 'Invalid lp' during heap_xlog_delete  (Michael Paquier <michael@paquier.xyz>)
Responses Re: 'Invalid lp' during heap_xlog_delete  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
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 < michael@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

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pg_upgrade fails with non-standard ACL
Next
From: Amit Kapila
Date:
Subject: Re: Frequent HLL bitstream_unpack crashes