Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/backend/postmaster/checkpointer.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,11 +894,14 @@ CheckpointerShmemSize(void)
Size size;

/*
* Currently, the size of the requests[] array is arbitrarily set equal to
* NBuffers. This may prove too large or small ...
* The size of the requests[] array is arbitrarily set equal to NBuffers.
* But there is a cap of MAX_CHECKPOINT_REQUESTS to prevent accumulating
* too many checkpoint requests in the ring buffer.
*/
size = offsetof(CheckpointerShmemStruct, requests);
size = add_size(size, mul_size(NBuffers, sizeof(CheckpointerRequest)));
size = add_size(size, mul_size(Min(NBuffers,
MAX_CHECKPOINT_REQUESTS),
sizeof(CheckpointerRequest)));

return size;
}
Expand Down