FullTransactionIdAdvance question - Mailing list pgsql-hackers

From Andy Fan
Subject FullTransactionIdAdvance question
Date
Msg-id 87frpu4qcf.fsf@163.com
Whole thread Raw
Responses Re: FullTransactionIdAdvance question
List pgsql-hackers
Hi,

static inline void
FullTransactionIdAdvance(FullTransactionId *dest)
{
    dest->value++;

    /* see FullTransactionIdAdvance() */
    if (FullTransactionIdPrecedes(*dest, FirstNormalFullTransactionId))
        return;

    while (XidFromFullTransactionId(*dest) < FirstNormalTransactionId)
        dest->value++;
}

I understand this functiona as: 'dest->value++' increases the epoch when
necessary and we don't want use the TransactionId which is smaller than
FirstNormalTransactionId. But what is the point of the below code:

/* see FullTransactionIdAdvance() */
if (FullTransactionIdPrecedes(*dest, FirstNormalFullTransactionId))
    return;

It looks to me it will be never true(I added a 'Assert(false);' above
the return, make check-world pass). and if it is true somehow, retruning
a XID which is smaller than FirstNormalTransactionId looks strange as
well. IIUC, should we remove it to save a prediction on each
GetNewTransactionId call?   

-- 
Best Regards
Andy Fan




pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: not null constraints, again
Next
From: shveta malik
Date:
Subject: Re: Allow logical failover slots to wait on synchronous replication