copyflags.patch
text/x-diff
Filename: copyflags.patch
Type: text/x-diff
Part: 0
Patch
Format: unified
| File | + | − |
|---|---|---|
| src/backend/storage/ipc/procarray.c | 6 | 9 |
diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c
index 25c310f675..4347941568 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -2685,17 +2685,14 @@ ProcArrayInstallRestoredXmin(TransactionId xmin, PGPROC *proc)
TransactionIdIsNormal(xid) &&
TransactionIdPrecedesOrEquals(xid, xmin))
{
- /* Install xmin */
+ /*
+ * Install xmin. In addition, propagate 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 |= (proc->statusFlags & PROC_COPYABLE_FLAGS);
+ ProcGlobal->statusFlags[MyProc->pgxactoff] = MyProc->statusFlags;
result = true;
}