From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Revive "snapshot too old" with wal_level=minimal and SET TABLESP
Date: Sat, 30 Jan 2021 08:36:47 +0000
Message-ID: <E1l5lkN-0004Zq-WB@gemulon.postgresql.org> (raw)
Revive "snapshot too old" with wal_level=minimal and SET TABLESPACE.
Given a permanent relation rewritten in the current transaction, the
old_snapshot_threshold mechanism assumed the relation had never been
subject to early pruning. Hence, a query could fail to report "snapshot
too old" when the rewrite followed an early truncation. ALTER TABLE SET
TABLESPACE is probably the only rewrite mechanism capable of exposing
this bug. REINDEX sets indcheckxmin, avoiding the problem. CLUSTER has
zeroed page LSNs since before old_snapshot_threshold existed, so
old_snapshot_threshold has never cooperated with it. ALTER TABLE
... SET DATA TYPE makes the table look empty to every past snapshot,
which is strictly worse. Back-patch to v13, where commit
c6b92041d38512a4176ed76ad06f713d2e6c01a8 broke this.
Kyotaro Horiguchi and Noah Misch
Discussion: https://postgr.es/m/20210113.160705.2225256954956139776.horikyota.ntt@gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/7da83415e5bc01bba0093f34f4f612b70c70b678
Modified Files
--------------
src/backend/utils/time/snapmgr.c | 6 +++++-
src/include/utils/snapmgr.h | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: noah@leadboat.com
Subject: Re: pgsql: Revive "snapshot too old" with wal_level=minimal and SET TABLESP
In-Reply-To: <E1l5lkN-0004Zq-WB@gemulon.postgresql.org>
References: <E1l5lkN-0004Zq-WB@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox