Re: Fix for consume_xids advancing XIDs incorrectly - Mailing list pgsql-hackers

From Yushi Ogiwara
Subject Re: Fix for consume_xids advancing XIDs incorrectly
Date
Msg-id 710b46d68d053eac91c9c8ec9feea09d@oss.nttdata.com
Whole thread Raw
In response to Re: Fix for consume_xids advancing XIDs incorrectly  (Masahiko Sawada <sawada.mshk@gmail.com>)
Responses Re: Fix for consume_xids advancing XIDs incorrectly
List pgsql-hackers
>> 
>> 
>>         consumed = XidSkip(nextXid);
>>         if (consumed > 0)
>>                 TransamVariables->nextXid.value += (uint64) consumed;
>> 
>> BTW, the code snippet above in consume_xids_shortcut() could 
>> potentially set
>> the next XID to a value below FirstNormalTransactionId? If yes, we 
>> should account for
>> FirstNormalFullTransactionId when increasing the next XID, similar to
>> how FullTransactionIdAdvance() handles it.
> 
> Good catch. I agree with you. We need to do something similar to what
> FullTransactionIdAdvance() does so that it does not appear as a
> special 32-bit XID.
> 
> Regards,

I think this is not the case since XidSkip returns min(UINT32_MAX - 5 - 
low, *), which prevents the wrap-around of nextXid.

Regards,
Yushi Ogiwara



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Support regular expressions with nondeterministic collations
Next
From: Peter Eisentraut
Date:
Subject: Re: define pg_structiszero(addr, s, r)