diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 9aa56e5e4bc..4b84f3853d7 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -68,6 +68,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)) @@ -2526,7 +2527,7 @@ GetVictimBuffer(BufferAccessStrategy strategy, IOContext io_context) uint32 GetPinLimit(void) { - return MaxProportionalPins; + return get_pin_limit_hook ? get_pin_limit_hook() : MaxProportionalPins; } /* diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h index 804adf77a82..966b60b5cb0 100644 --- a/src/include/storage/bufmgr.h +++ b/src/include/storage/bufmgr.h @@ -334,6 +334,7 @@ extern int GetAccessStrategyPinLimit(BufferAccessStrategy strategy); extern void FreeAccessStrategy(BufferAccessStrategy strategy); +extern uint32 (*get_pin_limit_hook)(void); /* inline functions */