Skip to content

Commit 336a578

Browse files
committed
Fix incorrect assertion about historical snapshots.
Also fix some nearby comments. Andres Freund
1 parent 890194f commit 336a578

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/backend/utils/time/snapmgr.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,11 @@ Snapshot
261261
GetCatalogSnapshot(Oid relid)
262262
{
263263
/*
264-
* Return historic snapshot if we're doing logical decoding, but
265-
* return a non-historic, snapshot if we temporarily are doing up2date
266-
* lookups.
264+
* Return historic snapshot while we're doing logical decoding, so we can
265+
* see the appropriate state of the catalog.
266+
*
267+
* This is the primary reason for needing to reset the system caches after
268+
* finishing decoding.
267269
*/
268270
if (HistoricSnapshotActive())
269271
return HistoricSnapshot;
@@ -352,7 +354,7 @@ SetTransactionSnapshot(Snapshot sourcesnap, TransactionId sourcexid)
352354

353355
Assert(RegisteredSnapshots == 0);
354356
Assert(FirstXactSnapshot == NULL);
355-
Assert(HistoricSnapshotActive());
357+
Assert(!HistoricSnapshotActive());
356358

357359
/*
358360
* Even though we are not going to use the snapshot it computes, we must

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy