mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Repurpose PROC_COPYABLE_FLAGS as PROC_XMIN_FLAGS
This is a slight, convenient semantics change from what commit0f0cfb4940
("Fix parallel operations that prevent oldest xmin from advancing") introduced that lets us simplify the coding in the one place where it is used. Backpatch to 13. This is related to commit6fea65508a
("Tighten ComputeXidHorizons' handling of walsenders") rewriting the code site where this is used, which has not yet been backpatched, but it may well be in the future. Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com> Discussion: https://postgr.es/m/202204191637.eldwa2exvguw@alvherre.pgsql
This commit is contained in:
@ -2685,17 +2685,14 @@ ProcArrayInstallRestoredXmin(TransactionId xmin, PGPROC *proc)
|
||||
TransactionIdIsNormal(xid) &&
|
||||
TransactionIdPrecedesOrEquals(xid, xmin))
|
||||
{
|
||||
/* Install xmin */
|
||||
/*
|
||||
* Install xmin and propagate the statusFlags that affect how the
|
||||
* value is interpreted by vacuum.
|
||||
*/
|
||||
MyProc->xmin = TransactionXmin = xmin;
|
||||
|
||||
/* walsender cheats by passing proc == MyProc, don't check its flags */
|
||||
if (proc != MyProc)
|
||||
{
|
||||
/* Flags being copied must be valid copy-able flags. */
|
||||
Assert((proc->statusFlags & (~PROC_COPYABLE_FLAGS)) == 0);
|
||||
MyProc->statusFlags = proc->statusFlags;
|
||||
ProcGlobal->statusFlags[MyProc->pgxactoff] = MyProc->statusFlags;
|
||||
}
|
||||
MyProc->statusFlags = (MyProc->statusFlags & ~PROC_XMIN_FLAGS) |
|
||||
(proc->statusFlags & PROC_XMIN_FLAGS);
|
||||
ProcGlobal->statusFlags[MyProc->pgxactoff] = MyProc->statusFlags;
|
||||
|
||||
result = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user