Repurpose PROC_COPYABLE_FLAGS as PROC_XMIN_FLAGS
This is a slight, convenient semantics change from what commit 0f0cfb494004 ("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 commit 6fea65508a1a ("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:
parent
3f712ea6dc
commit
8d9d1286ac
@ -2686,12 +2686,13 @@ ProcArrayInstallRestoredXmin(TransactionId xmin, PGPROC *proc)
|
|||||||
TransactionIdIsNormal(xid) &&
|
TransactionIdIsNormal(xid) &&
|
||||||
TransactionIdPrecedesOrEquals(xid, xmin))
|
TransactionIdPrecedesOrEquals(xid, xmin))
|
||||||
{
|
{
|
||||||
/* Install xmin */
|
/*
|
||||||
|
* Install xmin and propagate the statusFlags that affect how the
|
||||||
|
* value is interpreted by vacuum.
|
||||||
|
*/
|
||||||
MyProc->xmin = TransactionXmin = xmin;
|
MyProc->xmin = TransactionXmin = xmin;
|
||||||
|
MyProc->statusFlags = (MyProc->statusFlags & ~PROC_XMIN_FLAGS) |
|
||||||
/* Flags being copied must be valid copy-able flags. */
|
(proc->statusFlags & PROC_XMIN_FLAGS);
|
||||||
Assert((proc->statusFlags & (~PROC_COPYABLE_FLAGS)) == 0);
|
|
||||||
MyProc->statusFlags = proc->statusFlags;
|
|
||||||
ProcGlobal->statusFlags[MyProc->pgxactoff] = MyProc->statusFlags;
|
ProcGlobal->statusFlags[MyProc->pgxactoff] = MyProc->statusFlags;
|
||||||
|
|
||||||
result = true;
|
result = true;
|
||||||
|
@ -66,11 +66,10 @@ struct XidCache
|
|||||||
(PROC_IN_VACUUM | PROC_IN_SAFE_IC | PROC_VACUUM_FOR_WRAPAROUND)
|
(PROC_IN_VACUUM | PROC_IN_SAFE_IC | PROC_VACUUM_FOR_WRAPAROUND)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Flags that are valid to copy from another proc, the parallel leader
|
* Xmin-related flags. Make sure any flags that affect how the process' Xmin
|
||||||
* process in practice. Currently, flags that are set during parallel
|
* value is interpreted by VACUUM are included here.
|
||||||
* vacuum and parallel index creation are allowed.
|
|
||||||
*/
|
*/
|
||||||
#define PROC_COPYABLE_FLAGS (PROC_IN_VACUUM | PROC_IN_SAFE_IC)
|
#define PROC_XMIN_FLAGS (PROC_IN_VACUUM | PROC_IN_SAFE_IC)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We allow a small number of "weak" relation locks (AccessShareLock,
|
* We allow a small number of "weak" relation locks (AccessShareLock,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user