Re: An improvement of ProcessTwoPhaseBuffer logic

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Vitaly Davydov <v(dot)davydov(at)postgrespro(dot)ru>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: An improvement of ProcessTwoPhaseBuffer logic
Date: 2024-12-26 05:34:48
Message-ID: Z2zq-GrOpIDPOHUj@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 26, 2024 at 07:42:34AM +0900, Michael Paquier wrote:
> I suspect that this can be still dangerous as-is while complicating
> the code with more possible paths for the removal of the 2PC files,
> because we may still build a file name from an XID, and that's what's
> causing this issue..

Here are two patches to address both issues:
- 0001 for the epoch calculation, down to 17, which would take care of
the underflow problem when having a 2PC file that has an XID in the
future at epoch 0. It is true that it could be smarter when dealing
with files from other epochs, and that this is a problem in v17~. I
think that this should integrate better with FullTransactionIds moving
forward rather than pass the file names. That would be something
quite invasive, only for HEAD. At least that's my impression.
- 0002, to take care of the future file issue, down to 13. This
includes a TAP test to demonstrate the problem. The test needs a
tweak for the 2PC file name in v17~.
--
Michael

Attachment Content-Type Size
v1-0001-Fix-failure-with-incorrect-epoch-for-future-2PC-f.patch text/x-diff 1.4 KB
v1-0002-Fix-handling-of-orphaned-2PC-files-in-the-future-.patch text/x-diff 5.4 KB
v1-0002-Fix-handling-of-orphaned-2PC-files-in-the-fut-v16.patch text/x-diff 3.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhijie Hou (Fujitsu) 2024-12-26 06:02:20 RE: Introduce XID age and inactive timeout based replication slot invalidation
Previous Message torikoshia 2024-12-26 04:15:59 Re: RFC: Allow EXPLAIN to Output Page Fault Information