From: | Noah Misch <noah(at)leadboat(dot)com> |
---|---|
To: | Heikki Linnakangas <hlinnaka(at)iki(dot)fi> |
Cc: | Andres Freund <andres(at)anarazel(dot)de>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: A few patches to clarify snapshot management |
Date: | 2025-08-20 00:37:56 |
Message-ID: | 20250820003756.31.nmisch@google.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, Aug 19, 2025 at 11:45:01PM +0300, Heikki Linnakangas wrote:
> How about the attached, then? It reverts the GetTransactionSnapshot()
> change. But to still catch at least some of the invalid uses of the historic
> snapshot, it adds checks to heap_beginscan() and index_beginscan(), to
> complain if they are called on a non-catalog relation with a historic
> snapshot.
> @@ -1143,6 +1143,15 @@ heap_beginscan(Relation relation, Snapshot snapshot,
> if (!(snapshot && IsMVCCSnapshot(snapshot)))
> scan->rs_base.rs_flags &= ~SO_ALLOW_PAGEMODE;
>
> + /* Check that a historic snapshot is not used for non-catalog tables */
> + if (snapshot &&
> + IsHistoricMVCCSnapshot(snapshot) &&
> + !RelationIsAccessibleInLogicalDecoding(relation))
> + {
> + elog(ERROR, "cannot query non-catalog table \"%s\" during logical decoding",
> + RelationGetRelationName(relation));
> + }
> +
I feel post-beta3 is late for debut of restrictions like this. How about a
pure revert, then add those restrictions in v19? Should be s/elog/ereport/,
also.
From | Date | Subject | |
---|---|---|---|
Next Message | Masahiko Sawada | 2025-08-20 00:43:41 | Re: memory leak in logical WAL sender with pgoutput's cachectx |
Previous Message | Thomas Munro | 2025-08-20 00:11:06 | Re: VM corruption on standby |