Re: Fix orphaned 2pc file which may casue instance restart failed

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: 清浅 <drec(dot)wu(at)foxmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix orphaned 2pc file which may casue instance restart failed
Date: 2024-10-01 06:49:53
Message-ID: ZvubkV1zN6QnyvyG@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 11, 2024 at 06:21:37PM +0900, Michael Paquier wrote:
>> If gxact1's local xid is not frozen, the startup process will remove
>> the orphaned 2pc file. However, if the xid's corresponding clog file is
>> truncated by `vacuum`, the startup process will raise error 'could not
>> access status of transaction xxx', due to it could not found the
>> transaction's status file in dir `pg_xact`.
>
> Hmm. I've not seen that in the field. Let me check that..

Ah, yes, that's clearly broken. The origin of the problem was
effe7d9552dd, which was from me, so backpatched all the way down after
adding a comment explaining the reason why we'd better read the value
before the 2PC state lock is released.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Anthonin Bonnefoy 2024-10-01 07:26:40 Re: Set query_id for query contained in utility statement
Previous Message Amit Langote 2024-10-01 06:23:50 Re: Address the -Wuse-after-free warning in ATExecAttachPartition()