pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Revive "snapshot too old" with wal_level=minimal and SET TABLESP
2+ messages / 1 participants
[nested] [flat]

* pgsql: Revive "snapshot too old" with wal_level=minimal and SET TABLESP
@ 2021-01-30 08:36 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Noah Misch @ 2021-01-30 08:36 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Revive "snapshot too old" with wal_level=minimal and SET TABLESP
@ 2021-01-30 08:36 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Noah Misch @ 2021-01-30 08:36 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d798ea750d22ee4f546c5a4521f957ca610de5b1

Modified Files
--------------
src/backend/utils/time/snapmgr.c | 3 ++-
src/include/utils/snapmgr.h      | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2021-01-30 08:36 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-30 08:36 pgsql: Revive "snapshot too old" with wal_level=minimal and SET TABLESP Noah Misch <noah@leadboat.com>
2021-01-30 08:36 pgsql: Revive "snapshot too old" with wal_level=minimal and SET TABLESP Noah Misch <noah@leadboat.com>

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