Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8d9d128

Browse files
committed
Repurpose PROC_COPYABLE_FLAGS as PROC_XMIN_FLAGS
This is a slight, convenient semantics change from what commit0f0cfb4 ("Fix parallel operations that prevent oldest xmin fromadvancing") introduced that lets us simplify the coding in the one placewhere it is used.Backpatch to 13. This is related to commit6fea655 ("TightenComputeXidHorizons' handling of walsenders") rewriting the code sitewhere this is used, which has not yet been backpatched, but it may wellbe in the future.Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>Discussion:https://postgr.es/m/202204191637.eldwa2exvguw@alvherre.pgsql
1 parent3f712ea commit8d9d128

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

‎src/backend/storage/ipc/procarray.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2686,12 +2686,13 @@ ProcArrayInstallRestoredXmin(TransactionId xmin, PGPROC *proc)
26862686
TransactionIdIsNormal(xid)&&
26872687
TransactionIdPrecedesOrEquals(xid,xmin))
26882688
{
2689-
/* Install xmin */
2689+
/*
2690+
* Install xmin and propagate the statusFlags that affect how the
2691+
* value is interpreted by vacuum.
2692+
*/
26902693
MyProc->xmin=TransactionXmin=xmin;
2691-
2692-
/* Flags being copied must be valid copy-able flags. */
2693-
Assert((proc->statusFlags& (~PROC_COPYABLE_FLAGS))==0);
2694-
MyProc->statusFlags=proc->statusFlags;
2694+
MyProc->statusFlags= (MyProc->statusFlags& ~PROC_XMIN_FLAGS) |
2695+
(proc->statusFlags&PROC_XMIN_FLAGS);
26952696
ProcGlobal->statusFlags[MyProc->pgxactoff]=MyProc->statusFlags;
26962697

26972698
result= true;

‎src/include/storage/proc.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,10 @@ struct XidCache
6666
(PROC_IN_VACUUM | PROC_IN_SAFE_IC | PROC_VACUUM_FOR_WRAPAROUND)
6767

6868
/*
69-
* Flags that are valid to copy from another proc, the parallel leader
70-
* process in practice. Currently, flags that are set during parallel
71-
* vacuum and parallel index creation are allowed.
69+
* Xmin-related flags. Make sure any flags that affect how the process' Xmin
70+
* value is interpreted by VACUUM are included here.
7271
*/
73-
#definePROC_COPYABLE_FLAGS (PROC_IN_VACUUM | PROC_IN_SAFE_IC)
72+
#definePROC_XMIN_FLAGS (PROC_IN_VACUUM | PROC_IN_SAFE_IC)
7473

7574
/*
7675
* We allow a small number of "weak" relation locks (AccessShareLock,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp