=== Applying patches on top of PostgreSQL commit ID 787514b30bb7dd0b3484d6cb717e3b9aafc06c4a === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Wed Mar 26 08:01:30 UTC 2025 On branch cf/5619 nothing to commit, working tree clean === using 'git am' to apply patch ./v3-0001-Improve-buffer-manager-API-for-backend-pin-limits.patch === Applying: Improve buffer manager API for backend pin limits. Using index info to reconstruct a base tree... M src/backend/storage/buffer/bufmgr.c M src/backend/storage/buffer/localbuf.c M src/include/storage/bufmgr.h Falling back to patching base and 3-way merge... Auto-merging src/include/storage/bufmgr.h CONFLICT (content): Merge conflict in src/include/storage/bufmgr.h Auto-merging src/backend/storage/buffer/localbuf.c CONFLICT (content): Merge conflict in src/backend/storage/buffer/localbuf.c Auto-merging src/backend/storage/buffer/bufmgr.c CONFLICT (content): Merge conflict in src/backend/storage/buffer/bufmgr.c error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Improve buffer manager API for backend pin limits. When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". Unstaged changes after reset: M src/backend/storage/buffer/bufmgr.c M src/backend/storage/buffer/localbuf.c M src/include/storage/bufmgr.h === using patch(1) to apply patch ./v3-0001-Improve-buffer-manager-API-for-backend-pin-limits.patch === patch: unrecognized option `--no-backup-if-mismatch' usage: patch [-bCcEeflNnRstuv] [-B backup-prefix] [-D symbol] [-d directory] [-F max-fuzz] [-i patchfile] [-o out-file] [-p strip-count] [-r rej-name] [-V t | nil | never | none] [-x number] [-z backup-ext] [--posix] [origfile [patchfile]] patch >>>>>> theirs { return MaxProportionalPins; } /* * Return the maximum number of additional buffers that this backend should ++<<<<<<< ours + * pin if it wants to stay under the per-backend limit, considering the number + * of buffers it has already pinned. Unlike LimitAdditionalPins(), the limit + * return by this function can be zero. ++======= + * pin if it wants to stay under the per-backend soft limit, considering the + * number of buffers it has already pinned. Unlike LimitAdditionalPins(), the + * result can be zero, so the caller is expected to adjust it if required to + * make progress. ++>>>>>>> theirs */ uint32 GetAdditionalPinLimit(void) @@@ -3642,11 -3602,11 +3663,19 @@@ InitBufferManagerAccess(void HASHCTL hash_ctl; /* ++<<<<<<< ours + * An advisory limit on the number of pins each backend should hold, based + * on shared_buffers and the maximum number of connections possible. + * That's very pessimistic, but outside toy-sized shared_buffers it should + * allow plenty of pins. LimitAdditionalPins() and + * GetAdditionalPinLimit() can be used to check the remaining balance. ++======= + * The soft limit on the number of pins each backend should respect, based + * on shared_buffers and the maximum number of connections possible. + * That's very pessimistic, but outside toy-sized shared_buffers it should + * allow plenty of pins. LimitAdditionalPins() or GetAdditionalPinLimit() + * can be used to check the remaining balance. ++>>>>>>> theirs */ MaxProportionalPins = NBuffers / (MaxBackends + NUM_AUXILIARY_PROCS); diff --cc src/backend/storage/buffer/localbuf.c index f172a5c7820,5378ba84316..00000000000 --- a/src/backend/storage/buffer/localbuf.c +++ b/src/backend/storage/buffer/localbuf.c @@@ -291,9 -286,9 +291,15 @@@ GetLocalVictimBuffer(void return BufferDescriptorGetBuffer(bufHdr); } ++<<<<<<< ours +/* see GetPinLimit() */ +uint32 +GetLocalPinLimit(void) ++======= + /* see GetSoftPinLimit() */ + uint32 + GetSoftLocalPinLimit(void) ++>>>>>>> theirs { /* Every backend has its own temporary buffers, and can pin them all. */ return num_temp_buffers; diff --cc src/include/storage/bufmgr.h index 538b890a51d,74b5afe8a1a..00000000000 --- a/src/include/storage/bufmgr.h +++ b/src/include/storage/bufmgr.h @@@ -291,8 -290,8 +291,13 @@@ extern bool HoldingBufferPinThatDelaysR extern bool BgBufferSync(struct WritebackContext *wb_context); ++<<<<<<< ours +extern uint32 GetPinLimit(void); +extern uint32 GetLocalPinLimit(void); ++======= + extern uint32 GetSoftPinLimit(void); + extern uint32 GetSoftLocalPinLimit(void); ++>>>>>>> theirs extern uint32 GetAdditionalPinLimit(void); extern uint32 GetAdditionalLocalPinLimit(void); extern void LimitAdditionalPins(uint32 *additional_pins);