Xmin calculations should consider only top transaction IDs, and
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 15 Aug 2004 17:03:36 +0000 (17:03 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 15 Aug 2004 17:03:36 +0000 (17:03 +0000)
therefore starting with GetCurrentTransactionId is wrong.  Fixes
miscomputation of RecentGlobalXmin leading to bizarre behavior
reported by Gavin Sherry.

src/backend/storage/ipc/sinval.c

index 57e39da4a4d7c0ebd218a91c1269cb3a5fc3f3e8..af046a3f1ec9a16260740defe2073e7dadd4aae9 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/storage/ipc/sinval.c,v 1.67 2004/08/01 17:32:16 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/storage/ipc/sinval.c,v 1.68 2004/08/15 17:03:36 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -673,7 +673,7 @@ GetOldestXmin(bool allDbs)
        TransactionId result;
        int                     index;
 
-       result = GetCurrentTransactionId();
+       result = GetTopTransactionId();
 
        LWLockAcquire(SInvalLock, LW_SHARED);
 
@@ -763,7 +763,7 @@ GetSnapshotData(Snapshot snapshot, bool serializable)
                                         errmsg("out of memory")));
        }
 
-       globalxmin = xmin = GetCurrentTransactionId();
+       globalxmin = xmin = GetTopTransactionId();
 
        /*
         * If we are going to set MyProc->xmin then we'd better get exclusive