What constrains the range of SERIALIZABLEXACT xmin values?

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: What constrains the range of SERIALIZABLEXACT xmin values?
Date: 2019-12-12 21:30:19
Message-ID: CA+hUKGKgvDq57AqpX-2HjauBSExtTKqkdiOzqWDkN6KR4o96ZA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Every SERIALIZABLEXACT holds an xmin that comes from a Snapshot, and
SxactGlobalXmin holds the oldest of them. But a SERIALIZABLEXACT can
live longer than a transaction and snapshot, so now I'm wondering if
it's possible to reach a state where there exist SERIALIZABLEXACT
objects with a range of xmin values that break the modular
TransactionIdPrecedes()-based logic in SetNewSxactGlobalXmin(), which
relies on the set of values not spanning more than half of the 2^32
clock. If that state is reachable, then I think the effect would be
to call ClearOldPredicateLocks() at the wrong times (too much and
we'll waste CPU in that function, not enough and we'll "leak"
predicate locks by not cleaning them up as eagerly as we intended).

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2019-12-12 21:35:49 Re: Make autovacuum sort tables in descending order of xid_age
Previous Message Peter Eisentraut 2019-12-12 21:11:36 MSYS2 support