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



Reply via email to