|
From: mason_s <ma...@us...> - 2010-05-15 22:39:44
|
Project "Postgres-XC: write-scalable synchronous multi-master PostgreSQL cluster".
The branch, master has been updated
via b075a9e103648e81c680e47210e43cbc71b5d958 (commit)
from ebcf8ba26b55a522b1a3e320064a35338edca83d (commit)
- Log -----------------------------------------------------------------
commit b075a9e103648e81c680e47210e43cbc71b5d958
Author: Mason S <mas...@ma...>
Date: Sat May 15 18:37:59 2010 -0400
Fix some assertion failures.
Also put back in setting of RecentXmin and RecentGlobalXmin
for the Coordinator.
Written by Pavan & Mason.
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c
index 9599b59..757f99d 100644
--- a/src/backend/access/transam/xact.c
+++ b/src/backend/access/transam/xact.c
@@ -1702,6 +1702,7 @@ CommitTransaction(void)
*/
DataNodeCommit(DestNone);
CommitTranGTM(s->globalTransactionId);
+ latestXid = s->globalTransactionId;
}
else if (IS_PGXC_DATANODE)
{
@@ -2147,6 +2148,7 @@ AbortTransaction(void)
*/
DataNodeRollback(DestNone);
RollbackTranGTM(s->globalTransactionId);
+ latestXid = s->globalTransactionId;
}
else if (IS_PGXC_DATANODE)
{
diff --git a/src/backend/pgxc/pool/poolmgr.c b/src/backend/pgxc/pool/poolmgr.c
index e386b2b..79106b5 100644
--- a/src/backend/pgxc/pool/poolmgr.c
+++ b/src/backend/pgxc/pool/poolmgr.c
@@ -563,7 +563,7 @@ agent_create(void)
void
PoolManagerConnect(PoolHandle *handle, const char *database)
{
- Assert(Handle);
+ Assert(handle);
Assert(database);
/* Save the handle */
@@ -1063,7 +1063,7 @@ acquire_connection(DatabasePool *dbPool, int node)
DataNodePoolSlot *slot;
Assert(dbPool);
- Assert(0 <= node && node < NumDataNodes);
+ Assert(0 < node && node <= NumDataNodes);
slot = NULL;
/* Find referenced node pool */
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c
index 4616475..be24657 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -296,6 +296,13 @@ ProcArrayEndTransaction(PGPROC *proc, TransactionId latestXid)
* anyone else's calculation of a snapshot. We might change their
* estimate of global xmin, but that's OK.
*/
+#ifdef PGXC
+ /*
+ * Removed this assertion check for PGXC on the Coordinator
+ * We could abort before the Coordinator has obtained a GXID
+ */
+ if (IS_PGXC_DATANODE)
+#endif
Assert(!TransactionIdIsValid(proc->xid));
proc->lxid = InvalidLocalTransactionId;
@@ -1645,11 +1652,13 @@ GetSnapshotDataCoordinator(Snapshot snapshot)
ereport(ERROR,
(errcode(ERRCODE_CONNECTION_FAILURE),
errmsg("GTM error, could not obtain snapshot")));
- else {
+ else
+ {
snapshot->xmin = gtm_snapshot->sn_xmin;
snapshot->xmax = gtm_snapshot->sn_xmax;
snapshot->recent_global_xmin = gtm_snapshot->sn_recent_global_xmin;
snapshot->xcnt = gtm_snapshot->sn_xcnt;
+ RecentGlobalXmin = gtm_snapshot->sn_recent_global_xmin;
elog(DEBUG1, "from GTM: xmin = %d, xmax = %d, xcnt = %d, RecGlobXmin = %d",
snapshot->xmin, snapshot->xmax, snapshot->xcnt, snapshot->recent_global_xmin);
/*
@@ -1715,6 +1724,7 @@ GetSnapshotDataCoordinator(Snapshot snapshot)
*
* !!TODO
*/
+ RecentXmin = snapshot->xmin;
/* PGXCTODO - set this until we handle subtransactions. */
snapshot->subxcnt = 0;
-----------------------------------------------------------------------
Summary of changes:
src/backend/access/transam/xact.c | 2 ++
src/backend/pgxc/pool/poolmgr.c | 4 ++--
src/backend/storage/ipc/procarray.c | 12 +++++++++++-
3 files changed, 15 insertions(+), 3 deletions(-)
hooks/post-receive
--
Postgres-XC: write-scalable synchronous multi-master PostgreSQL cluster
|