aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/clog.c
diff options
context:
space:
mode:
authorAmit Kapila <akapila@postgresql.org>2019-12-12 11:51:30 +0530
committerAmit Kapila <akapila@postgresql.org>2019-12-17 09:39:21 +0530
commit0eac283bfc8b893d91a1ecf184d2c8373a1ed906 (patch)
treea43a8508d1a45ccfa99452f5d0c1bc72118f8ff6 /src/backend/access/transam/clog.c
parent95f43fee91793cbcfaf13636a5936a5184fdafe3 (diff)
downloadpostgresql-0eac283bfc8b893d91a1ecf184d2c8373a1ed906.tar.gz
postgresql-0eac283bfc8b893d91a1ecf184d2c8373a1ed906.zip
Change overly strict Assert in TransactionGroupUpdateXidStatus.
This Assert thought that an overflowed transaction can never get registered for the group update.  But that is not true, because even when the number of children for a transaction got reduced, the overflow flag is not changed. And, for group update, we only care about the current number of children for a transaction that is being committed. Based on comments by Andres Freund, remove a redundant Assert in TransactionIdSetPageStatus as we already had a static Assert for the same condition a few lines earlier. Reported-by: Vignesh C Author: Dilip Kumar Reviewed-by: Amit Kapila Backpatch-through: 11 Discussion: https://postgr.es/m/CAFiTN-s5=uJw-Z6JC9gcqtBSjXsrHnU63PXBrA=pnBjqnkm5UA@mail.gmail.com
Diffstat (limited to 'src/backend/access/transam/clog.c')
-rw-r--r--src/backend/access/transam/clog.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/backend/access/transam/clog.c b/src/backend/access/transam/clog.c
index 47db7a8a88c..8a706445230 100644
--- a/src/backend/access/transam/clog.c
+++ b/src/backend/access/transam/clog.c
@@ -300,13 +300,6 @@ TransactionIdSetPageStatus(TransactionId xid, int nsubxids,
nsubxids * sizeof(TransactionId)) == 0)
{
/*
- * We don't try to do group update optimization if a process has
- * overflowed the subxids array in its PGPROC, since in that case we
- * don't have a complete list of XIDs for it.
- */
- Assert(THRESHOLD_SUBTRANS_CLOG_OPT <= PGPROC_MAX_CACHED_SUBXIDS);
-
- /*
* If we can immediately acquire CLogControlLock, we update the status
* of our own XID and release the lock. If not, try use group XID
* update. If that doesn't work out, fall back to waiting for the
@@ -520,10 +513,10 @@ TransactionGroupUpdateXidStatus(TransactionId xid, XidStatus status,
PGXACT *pgxact = &ProcGlobal->allPgXact[nextidx];
/*
- * Overflowed transactions should not use group XID status update
- * mechanism.
+ * Transactions with more than THRESHOLD_SUBTRANS_CLOG_OPT sub-XIDs
+ * should not use group XID status update mechanism.
*/
- Assert(!pgxact->overflowed);
+ Assert(pgxact->nxids <= THRESHOLD_SUBTRANS_CLOG_OPT);
TransactionIdSetPageStatusInternal(proc->clogGroupMemberXid,
pgxact->nxids,