1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

Fix GetNewTransactionId()'s interaction with xidVacLimit.

Commit ad308058 switched to returning a FullTransactionId, but
failed to load the potentially updated value in the case where
xidVacLimit is reached and we release and reacquire the lock.
Repair, closing bug #15727.

While reviewing that commit, also fix the size computation used
by EstimateTransactionStateSize() and switch to the mul_size()
macro traditionally used in such expressions.

Author: Thomas Munro
Reported-by: Roman Zharkov
Discussion: https://postgr.es/m/15727-0be246e7d852d229%40postgresql.org
This commit is contained in:
Thomas Munro
2019-04-12 14:53:38 +12:00
parent d87ab88686
commit f7feb020c3
2 changed files with 3 additions and 2 deletions

View File

@ -5151,7 +5151,7 @@ EstimateTransactionStateSpace(void)
nxids = add_size(nxids, s->nChildXids);
}
return add_size(size, sizeof(SerializedTransactionState) * nxids);
return add_size(size, mul_size(sizeof(TransactionId), nxids));
}
/*