Wraparound limits - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Wraparound limits
Date
Msg-id 53E35647.3040404@sigaev.ru
Whole thread Raw
Responses Re: Wraparound limits
List pgsql-hackers
Hi!

I have a questions about setting transaction's wraparound limits. Function 
SetTransactionIdLimit() in access/transam/varsup.c:

1)    xidWrapLimit = oldest_datfrozenxid + (MaxTransactionId >> 1);    if (xidWrapLimit < FirstNormalTransactionId)
  xidWrapLimit += FirstNormalTransactionId;
 

Isn't  it a problem if oldest_datfrozenxid > MaxTransactionId/2?

2)    xidStopLimit = xidWrapLimit - 1000000;    if (xidStopLimit < FirstNormalTransactionId)        xidStopLimit -=
FirstNormalTransactionId;
    xidWarnLimit = xidStopLimit - 10000000;    if (xidWarnLimit < FirstNormalTransactionId)        xidWarnLimit -=
FirstNormalTransactionId;

Why does it use '-' instead of '+' if variable < FirstNormalTransactionId? In 
this case it is easy to get xidStopLimit > xidWrapLimit or xidWarnLimit > 
xidStopLimit...


Thank you.

-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 



pgsql-hackers by date:

Previous
From: Marko Tiikkaja
Date:
Subject: Re: pgcrypto: PGP signatures
Next
From: Maxence Ahlouche
Date:
Subject: [GSoC] kmedoids status report