From: Pavan Deolasee Date: Thu, 21 Feb 2019 13:20:18 +0000 (+0530) Subject: Do not report txn commit/abort to the GTM via parallel worker. X-Git-Tag: XL_10_R1_1~1 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=ce5581bd0f071b994299a58db3c3e6e137a226c4;p=postgres-xl.git Do not report txn commit/abort to the GTM via parallel worker. We've seen a race condition where a parallel worker process on the coordinator pre-maturely reports txn status to the GTM, resulting in cleanup of the txn from the GTM. This is wrong and we must let the leader process do this. This may not fully explain some of the recent reports we have seen with catalog corruptions where an updated row is marked visible as its xmax is seen as aborted. But this looks like a sane fix anyways. So push it while we continue to investigate the reported problem. --- diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index 2de7ec0a98..157af41635 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -2749,7 +2749,7 @@ AtEOXact_GlobalTxn(bool commit) { TransactionState s = CurrentTransactionState; - if (IS_PGXC_LOCAL_COORDINATOR) + if (IS_PGXC_LOCAL_COORDINATOR && !IsParallelWorker()) { if (commit) { @@ -2783,7 +2783,7 @@ AtEOXact_GlobalTxn(bool commit) * So directly report transaction end. However this applies only if * the connection is directly from a client. */ - else if (IsXidFromGTM) + else if (IsXidFromGTM && !IsParallelWorker()) { IsXidFromGTM = false; if (commit)