* absorbed by the checkpointer.
*
* Unlike the checkpoint fields, num_backend_writes, num_backend_fsync, and
- * the requests fields are protected by BgWriterCommLock.
+ * the requests fields are protected by CheckpointerCommLock.
*----------
*/
typedef struct
if (am_checkpointer)
elog(ERROR, "ForwardFsyncRequest must not be called in checkpointer");
- LWLockAcquire(BgWriterCommLock, LW_EXCLUSIVE);
+ LWLockAcquire(CheckpointerCommLock, LW_EXCLUSIVE);
/* Count all backend writes regardless of if they fit in the queue */
BgWriterShmem->num_backend_writes++;
* fsync
*/
BgWriterShmem->num_backend_fsync++;
- LWLockRelease(BgWriterCommLock);
+ LWLockRelease(CheckpointerCommLock);
return false;
}
too_full = (BgWriterShmem->num_requests >=
BgWriterShmem->max_requests / 2);
- LWLockRelease(BgWriterCommLock);
+ LWLockRelease(CheckpointerCommLock);
/* ... but not till after we release the lock */
if (too_full && ProcGlobal->checkpointerLatch)
HTAB *htab;
bool *skip_slot;
- /* must hold BgWriterCommLock in exclusive mode */
- Assert(LWLockHeldByMe(BgWriterCommLock));
+ /* must hold CheckpointerCommLock in exclusive mode */
+ Assert(LWLockHeldByMe(CheckpointerCommLock));
/* Initialize temporary hash table */
MemSet(&ctl, 0, sizeof(ctl));
* We try to avoid holding the lock for a long time by copying the request
* array.
*/
- LWLockAcquire(BgWriterCommLock, LW_EXCLUSIVE);
+ LWLockAcquire(CheckpointerCommLock, LW_EXCLUSIVE);
/* Transfer stats counts into pending pgstats message */
BgWriterStats.m_buf_written_backend += BgWriterShmem->num_backend_writes;
}
BgWriterShmem->num_requests = 0;
- LWLockRelease(BgWriterCommLock);
+ LWLockRelease(CheckpointerCommLock);
for (request = requests; n > 0; request++, n--)
RememberFsyncRequest(request->rnode, request->forknum, request->segno);