public inbox for [email protected]
help / color / mirror / Atom feedFrom: Давыдов Виталий <[email protected]>
To: Michael Paquier <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: An improvement of ProcessTwoPhaseBuffer logic
Date: Thu, 26 Dec 2024 18:11:25 +0300
Message-ID: <152dda-676d7200-61-659acf0@102179597> (raw)
In-Reply-To: <[email protected]>
References: <13b5b6-676c3080-4d-531db900@47931709>
<[email protected]>
<[email protected]>
Hi Michael,
> Here are two patches to address both issues:
Thank you for the preparing the patches and test simplification. My bad, I overcompilcated it.
I concerned about twophase file name generation. The function TwoPhaseFilePath() is pretty straitforward and unambiguous in 16 and earlier versions. The logic of this function in 17+ seems to be more complex. I do not understand it clearly. But, I guess, it will work incorrectly after turning to a newer epoch, because the epoch is calculated from TransamVariables->nextXid, but not from problem xid. The same problem may happen if we are in epoch 1 or greater. It will produce a wrong file name, because the epoch will be obtained from the last xid, not from file name xid. In another words, the function AdjustToFullTransactionId assumes that if xid > TransamVariables->nextXid, then the xid from the previous epoch. I may be not the case in our scenario.
> 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
Agree, but we may pass file name into TwoPhaseFilePath if any, instead of creation of two functions as in the patch. The cost - two new if conditions. Using file names is pretty safe. Once we read the file and extract xid from its name, just pass this file name to TwoPhaseFilePath(). If not, try to generate it. Anyway, I do not insist on it, just try to discuss.
With best regards,
Vitaly
view thread (4+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: An improvement of ProcessTwoPhaseBuffer logic
In-Reply-To: <152dda-676d7200-61-659acf0@102179597>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox