summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorMichael P2011-07-14 04:56:00 +0000
committerMichael P2011-07-14 04:56:00 +0000
commitfb2a3a864dee367f2cfe76a3a4fff5e02cb94fc1 (patch)
treeca7f3807510fde2895da757f3bf72986fd009f6e /src/backend
parentf0f4ae5fddf646b1a41dd4d512fccdf9c9587254 (diff)
Performance issue with snapshot processing
This commit solves an issue with snapshot processing in the case where cluster was used under multiple Coordinators. When a Coordinator/Coordinator connection was initialized, backend coordinator initialized a transaction to GTM that was never committed. A consequence of that was Snapshot xmin that remained to a constant value. Another consequence was recent global Xmin value set to a lower value, making autovacuum having absolutely no effects. This fix improves performance of the whole cluster by making autovacuum remove correctly old tuples for long-period runs.
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/access/transam/varsup.c3
-rw-r--r--src/backend/storage/ipc/procarray.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/access/transam/varsup.c b/src/backend/access/transam/varsup.c
index a5ff7537b3..1c684f5dfc 100644
--- a/src/backend/access/transam/varsup.c
+++ b/src/backend/access/transam/varsup.c
@@ -203,7 +203,8 @@ GetNewTransactionId(bool isSubXact)
increment_xid = false;
elog(DEBUG1, "xid (%d) does not follow ShmemVariableCache->nextXid (%d)",
xid, ShmemVariableCache->nextXid);
- } else
+ }
+ else
ShmemVariableCache->nextXid = xid;
}
else
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c
index 2de6db4511..5477df663b 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -1234,7 +1234,8 @@ GetSnapshotData(Snapshot snapshot)
if (GetSnapshotDataDataNode(snapshot))
return snapshot;
/* else fallthrough */
- } else if (IS_PGXC_COORDINATOR && !IsConnFromCoord())
+ }
+ else if (IS_PGXC_COORDINATOR && !IsConnFromCoord() && IsNormalProcessingMode())
{
/* Snapshot has ever been received from remote Coordinator */
if (GetSnapshotDataCoordinator(snapshot))