From: | Zhang Mingli <zmlpostgres(at)gmail(dot)com> |
---|---|
To: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | doubt about FullTransactionIdAdvance() |
Date: | 2022-10-22 03:32:47 |
Message-ID: | 28a845ea-d31b-4631-8347-4d0ac5e21c1b@Spark |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi, hackers
I don't quite understand FullTransactionIdAdvance(), correct me if I’m wrong.
/*
* Advance a FullTransactionId variable, stepping over xids that would appear
* to be special only when viewed as 32bit XIDs.
*/
static inline void
FullTransactionIdAdvance(FullTransactionId *dest)
{
dest->value++;
/* see FullTransactionIdAdvance() */
if (FullTransactionIdPrecedes(*dest, FirstNormalFullTransactionId))
return;
while (XidFromFullTransactionId(*dest) < FirstNormalTransactionId)
dest->value++;
}
#define XidFromFullTransactionId(x) ((x).value)
#define FullTransactionIdPrecedes(a, b) ((a).value < (b).value)
Can the codes reach line: while (XidFromFullTransactionId(*dest) < FirstNormalTransactionId)?
As we will return if (FullTransactionIdPrecedes(*dest, FirstNormalFullTransactionId)), and the two judgements seem equal.
Another confusion is the comments: /* see FullTransactionIdAdvance() */, is its own itself.
Could anyone explain this? Thanks in advance.
Regards,
Zhang Mingli
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2022-10-22 07:56:06 | Re: Crash after a call to pg_backup_start() |
Previous Message | Zhang Mingli | 2022-10-22 03:21:55 | Re: Add 64-bit XIDs into PostgreSQL 15 |