Re: [PATCH] Transaction traceability - txid_status(bigint)
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Craig Ringer <craig@2ndquadrant.com>
Cc: Petr Jelinek <petr@2ndquadrant.com>, Simon Riggs <simon@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Andres Freund <andres@anarazel.de>, Jim Nasby <Jim.Nasby@bluetreble.com>, Álvaro Herrera <alvaro.herrera@2ndquadrant.com>
Date: 2017-03-09T18:55:25Z
Lists: pgsql-hackers
On Wed, Jan 25, 2017 at 12:44 AM, Craig Ringer <craig@2ndquadrant.com> wrote: >> The way that SetTransactionIdLimit() now works looks a bit dangerous. >> xidWrapLimit, xidStopLimit, and xidWarnLimit are computed based on the >> passed-in oldestXid value and written straight into shared memory. >> But the shared memory copy of oldestXid could have a different value. >> I'm not sure if that breaks anything, but it certainly weakens any >> confidence callers might have had that all those values are consistent >> with each other. > > This was my main hesitation with the whole thing too. > > It's necessary to advance oldestXmin before we xlog the advance and > truncate clog, and necessary to advance the vacuum limits only > afterwards. Well, that's why I tried to advocate that their should be two separate XID limits in shared memory: leave what's there now the way it is, and then add a new limit for "don't try to look up XIDs before this point: splat". I still think that'd be less risky. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Add a txid_status function.
- 857ee8e391ff 10.0 landed
-
Track the oldest XID that can be safely looked up in CLOG.
- ea42cc18c353 10.0 landed