Skip to content

Commit e5bb679

Browse files
committed
Add get_pin_limit_hook
1 parent 9f23ff3 commit e5bb679

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/backend/storage/buffer/bufmgr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
#include "utils/resowner.h"
6969
#include "utils/timestamp.h"
7070

71+
uint32 (*get_pin_limit_hook)(void);
7172

7273
/* Note: these two macros only work on shared buffers, not local ones! */
7374
#define BufHdrGetBlock(bufHdr) ((Block) (BufferBlocks + ((Size) (bufHdr)->buf_id) * BLCKSZ))
@@ -2526,7 +2527,7 @@ GetVictimBuffer(BufferAccessStrategy strategy, IOContext io_context)
25262527
uint32
25272528
GetPinLimit(void)
25282529
{
2529-
return MaxProportionalPins;
2530+
return get_pin_limit_hook ? get_pin_limit_hook() : MaxProportionalPins;
25302531
}
25312532

25322533
/*

src/include/storage/bufmgr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ extern int GetAccessStrategyPinLimit(BufferAccessStrategy strategy);
334334

335335
extern void FreeAccessStrategy(BufferAccessStrategy strategy);
336336

337+
extern uint32 (*get_pin_limit_hook)(void);
337338

338339
/* inline functions */
339340

0 commit comments

Comments
 (0)