Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Fix incorrect assertion about historical snapshots.
authorRobert Haas <rhaas@postgresql.org>
Wed, 12 Mar 2014 18:07:41 +0000 (14:07 -0400)
committerRobert Haas <rhaas@postgresql.org>
Wed, 12 Mar 2014 18:07:41 +0000 (14:07 -0400)
Also fix some nearby comments.

Andres Freund

src/backend/utils/time/snapmgr.c

index 4146527d2fd377586f08065ccb5713d328c3ffc1..9802fa7ded75275cee84a7e2f642c3973f8915ea 100644 (file)
@@ -261,9 +261,11 @@ Snapshot
 GetCatalogSnapshot(Oid relid)
 {
    /*
-    * Return historic snapshot if we're doing logical decoding, but
-    * return a non-historic, snapshot if we temporarily are doing up2date
-    * lookups.
+    * Return historic snapshot while we're doing logical decoding, so we can
+    * see the appropriate state of the catalog.
+    *
+    * This is the primary reason for needing to reset the system caches after
+    * finishing decoding.
     */
    if (HistoricSnapshotActive())
        return HistoricSnapshot;
@@ -352,7 +354,7 @@ SetTransactionSnapshot(Snapshot sourcesnap, TransactionId sourcexid)
 
    Assert(RegisteredSnapshots == 0);
    Assert(FirstXactSnapshot == NULL);
-   Assert(HistoricSnapshotActive());
+   Assert(!HistoricSnapshotActive());
 
    /*
     * Even though we are not going to use the snapshot it computes, we must