Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion src/backend/storage/buffer/bufmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
#include "utils/resowner.h"
#include "utils/timestamp.h"

uint32 (*get_pin_limit_hook)(void);

/* Note: these two macros only work on shared buffers, not local ones! */
#define BufHdrGetBlock(bufHdr) ((Block) (BufferBlocks + ((Size) (bufHdr)->buf_id) * BLCKSZ))
Expand Down Expand Up @@ -2131,7 +2132,7 @@ LimitAdditionalPins(uint32 *additional_pins)
return;

max_backends = MaxBackends + NUM_AUXILIARY_PROCS;
max_proportional_pins = NBuffers / max_backends;
max_proportional_pins = get_pin_limit_hook ? get_pin_limit_hook() : NBuffers / max_backends;

/*
* Subtract the approximate number of buffers already pinned by this
Expand Down
1 change: 1 addition & 0 deletions src/include/storage/bufmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ extern int GetAccessStrategyPinLimit(BufferAccessStrategy strategy);

extern void FreeAccessStrategy(BufferAccessStrategy strategy);

extern uint32 (*get_pin_limit_hook)(void);

/* inline functions */

Expand Down