ERROR: multixact X from before cutoff Y found to be still running
Nathan Bossart <bossartn@amazon.com>
From: "Bossart, Nathan" <bossartn@amazon.com>
To: "pgsql-bugs@postgresql.org" <pgsql-bugs@postgresql.org>
Cc: "Schneider, Jeremy" <schnjere@amazon.com>
Date: 2019-09-05T00:37:40Z
Lists: pgsql-bugs, pgsql-hackers
Attachments
- fix_multixact_limit.patch (application/octet-stream) patch
Hi,
Currently, if you hold a multixact open long enough to generate an
"oldest multixact is far in the past" message during VACUUM, you may
see the following ERROR:
WARNING: oldest multixact is far in the past
HINT: Close open transactions with multixacts soon to avoid wraparound problems.
ERROR: multixact X from before cutoff Y found to be still running
Upon further inspection, I found that this is because the multixact
limit used in this case is the threshold for which we emit the "oldest
multixact" message. Instead, I think the multixact limit should be
set to the result of GetOldestMultiXactId(), effectively forcing a
minimum freeze age of zero. The ERROR itself is emitted by
FreezeMultiXactId() and appears to be a safeguard against problems
like this.
I've attached a patch to set the limit to the oldest multixact instead
of the "safeMxactLimit" in this case. I'd like to credit Jeremy
Schneider as the original reporter.
Nathan
Commits
-
Fix bug that could try to freeze running multixacts.
- 0640f032abe5 9.6.16 landed
- 486a8f152233 12.1 landed
- 6f1e336de010 11.6 landed
- 583d86f92aab 10.11 landed
- c1443eebe5a8 9.5.20 landed
- 080cf32d2231 9.4.25 landed
- 6bda2af039d4 13.0 landed
-
Teach autovacuum about multixact member wraparound.
- 53bb309d2d5a 9.5.0 cited
-
Separate multixact freezing parameters from xid's
- 801c2dc72cb3 9.4.0 cited