File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -483,7 +483,7 @@ vacuum_set_xid_limits(Relation rel,
483
483
int mxid_freezemin ;
484
484
int effective_multixact_freeze_max_age ;
485
485
TransactionId limit ;
486
- TransactionId safeLimit ;
486
+ TransactionId safeLimit , nextXid ;
487
487
MultiXactId mxactLimit ;
488
488
MultiXactId safeMxactLimit ;
489
489
@@ -525,8 +525,10 @@ vacuum_set_xid_limits(Relation rel,
525
525
* autovacuum_freeze_max_age / 2 XIDs old), complain and force a minimum
526
526
* freeze age of zero.
527
527
*/
528
- safeLimit = ReadNewTransactionId () - autovacuum_freeze_max_age ;
529
- if (!TransactionIdIsNormal (safeLimit ))
528
+ nextXid = ReadNewTransactionId ();
529
+ if (nextXid > FirstNormalTransactionId + autovacuum_freeze_max_age )
530
+ safeLimit = ReadNewTransactionId () - autovacuum_freeze_max_age ;
531
+ else
530
532
safeLimit = FirstNormalTransactionId ;
531
533
532
534
if (TransactionIdPrecedes (limit , safeLimit ))
You can’t perform that action at this time.
0 commit comments