Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit af3290f

Browse files
author
Amit Kapila
committed
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
1 parent fcf3b69 commit af3290f

File tree

1 file changed

+3
-10
lines changed
  • src/backend/access/transam

1 file changed

+3
-10
lines changed

src/backend/access/transam/clog.c

+3-10
Original file line numberDiff line numberDiff line change
@@ -299,13 +299,6 @@ TransactionIdSetPageStatus(TransactionId xid, int nsubxids,
299299
memcmp(subxids, MyProc->subxids.xids,
300300
nsubxids * sizeof(TransactionId)) == 0)
301301
{
302-
/*
303-
* We don't try to do group update optimization if a process has
304-
* overflowed the subxids array in its PGPROC, since in that case we
305-
* don't have a complete list of XIDs for it.
306-
*/
307-
Assert(THRESHOLD_SUBTRANS_CLOG_OPT <= PGPROC_MAX_CACHED_SUBXIDS);
308-
309302
/*
310303
* If we can immediately acquire CLogControlLock, we update the status
311304
* of our own XID and release the lock. If not, try use group XID
@@ -520,10 +513,10 @@ TransactionGroupUpdateXidStatus(TransactionId xid, XidStatus status,
520513
PGXACT *pgxact = &ProcGlobal->allPgXact[nextidx];
521514

522515
/*
523-
* Overflowed transactions should not use group XID status update
524-
* mechanism.
516+
* Transactions with more than THRESHOLD_SUBTRANS_CLOG_OPT sub-XIDs
517+
* should not use group XID status update mechanism.
525518
*/
526-
Assert(!pgxact->overflowed);
519+
Assert(pgxact->nxids <= THRESHOLD_SUBTRANS_CLOG_OPT);
527520

528521
TransactionIdSetPageStatusInternal(proc->clogGroupMemberXid,
529522
pgxact->nxids,

0 commit comments

Comments
 (0)