Commit
34486b609 effectively redefined isBackgroundWorker as meaning
"not a regular backend", whereas before it had the narrower
meaning of AmBackgroundWorkerProcess(). For clarity, rename the
field to isRegularBackend and invert its sense.
Discussion: https://postgr.es/m/
1808397.
1735156190@sss.pgh.pa.us
proc->databaseId = databaseid;
proc->roleId = owner;
proc->tempNamespaceId = InvalidOid;
- proc->isBackgroundWorker = true;
+ proc->isRegularBackend = false;
proc->lwWaiting = LW_WS_NOT_WAITING;
proc->lwWaitMode = 0;
proc->waitLock = NULL;
if (proc->pid == 0)
continue; /* do not count prepared xacts */
- if (proc->isBackgroundWorker)
- continue; /* do not count background workers */
+ if (!proc->isRegularBackend)
+ continue; /* count only regular backend processes */
if (!OidIsValid(databaseid) ||
proc->databaseId == databaseid)
count++;
if (proc->pid == 0)
continue; /* do not count prepared xacts */
- if (proc->isBackgroundWorker)
- continue; /* do not count background workers */
+ if (!proc->isRegularBackend)
+ continue; /* count only regular backend processes */
if (proc->roleId == roleid)
count++;
}
MyProc->databaseId = InvalidOid;
MyProc->roleId = InvalidOid;
MyProc->tempNamespaceId = InvalidOid;
- MyProc->isBackgroundWorker = !AmRegularBackendProcess();
+ MyProc->isRegularBackend = AmRegularBackendProcess();
MyProc->delayChkptFlags = 0;
MyProc->statusFlags = 0;
/* NB -- autovac launcher intentionally does not set IS_AUTOVACUUM */
MyProc->databaseId = InvalidOid;
MyProc->roleId = InvalidOid;
MyProc->tempNamespaceId = InvalidOid;
- MyProc->isBackgroundWorker = true;
+ MyProc->isRegularBackend = false;
MyProc->delayChkptFlags = 0;
MyProc->statusFlags = 0;
MyProc->lwWaiting = LW_WS_NOT_WAITING;
* but its myProcLocks[] lists are valid.
*
* We allow many fields of this struct to be accessed without locks, such as
- * delayChkptFlags and isBackgroundWorker. However, keep in mind that writing
+ * delayChkptFlags and isRegularBackend. However, keep in mind that writing
* mirrored ones (see below) requires holding ProcArrayLock or XidGenLock in
* at least shared mode, so that pgxactoff does not change concurrently.
*
Oid tempNamespaceId; /* OID of temp schema this backend is
* using */
- bool isBackgroundWorker; /* true if not a regular backend. */
+ bool isRegularBackend; /* true if it's a regular backend. */
/*
* While in hot standby mode, shows that a conflict signal has been sent