mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-08 15:09:24 +02:00
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
This commit is contained in:
parent
2cf51809b1
commit
fc68a10b57
@ -299,13 +299,6 @@ TransactionIdSetPageStatus(TransactionId xid, int nsubxids,
|
|||||||
memcmp(subxids, MyProc->subxids.xids,
|
memcmp(subxids, MyProc->subxids.xids,
|
||||||
nsubxids * sizeof(TransactionId)) == 0)
|
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
|
* If we can immediately acquire CLogControlLock, we update the status
|
||||||
* of our own XID and release the lock. If not, try use group XID
|
* of our own XID and release the lock. If not, try use group XID
|
||||||
@ -520,10 +513,10 @@ TransactionGroupUpdateXidStatus(TransactionId xid, XidStatus status,
|
|||||||
PGXACT *pgxact = &ProcGlobal->allPgXact[nextidx];
|
PGXACT *pgxact = &ProcGlobal->allPgXact[nextidx];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Overflowed transactions should not use group XID status update
|
* Transactions with more than THRESHOLD_SUBTRANS_CLOG_OPT sub-XIDs
|
||||||
* mechanism.
|
* should not use group XID status update mechanism.
|
||||||
*/
|
*/
|
||||||
Assert(!pgxact->overflowed);
|
Assert(pgxact->nxids <= THRESHOLD_SUBTRANS_CLOG_OPT);
|
||||||
|
|
||||||
TransactionIdSetPageStatusInternal(proc->clogGroupMemberXid,
|
TransactionIdSetPageStatusInternal(proc->clogGroupMemberXid,
|
||||||
pgxact->nxids,
|
pgxact->nxids,
|
||||||
|
Loading…
Reference in New Issue
Block a user