Mar - Apr 2023

16 commits
Support RBM_ZERO_AND_CLEANUP_LOCK in ExtendBufferedRelTo(), add tests
14 Apr 2023Andres Freundmaster16beta1REL_19_STABLE16beta1REL_18_STABLE16beta1REL_17_STABLE16beta1REL_16_STABLE16beta1Also in: Assertion being hit during WAL replay
LLM analysis, 100% suremodified before commitmoderate changesfrom patchset #511 of 1 reviewer saw the final version

The commit retains the cleanup-lock fix and recovery TAP test from #51, extends the fix to ReadBuffer_common, removes obsolete mode assertions, and adds dropped-relation test cases, as explained in #53.

  • Alexander Lakhinsaw the final versiontrailerHe confirmed the fix worked and identified the corresponding ReadBuffer_common assertion, which Andres addressed before committing along with additional tests #52 #53.
Use ExtendBufferedRelTo() in XLogReadBufferExtended()
7 Apr 2023Andres Freundmaster16beta1REL_19_STABLE16beta1REL_18_STABLE16beta1REL_17_STABLE16beta1REL_16_STABLE16beta1Also in: XLogReadBufferExtended() vs disconnected segments
LLM analysis, 100% surepart of a posted patchsetlight changesfrom patchset #450 of 1 reviewer saw the final version

This is the src/backend/access/transam/xlogutils.c portion of the combined ExtendBufferedRelTo conversion in #45. Andres explicitly described splitting it from the VM/FSM conversion #47.

  • Heikki Linnakangassaw an earlier versionLLM analysis, 91% sureHe proposed using the new extend-to interface in XLogReadBufferExtended during review of the earlier series, before that interface and conversion were implemented #23.
hio: Use ExtendBufferedRelBy() to extend tables more efficiently
6 Apr 2023Andres Freundmaster16beta1REL_19_STABLE16beta1REL_18_STABLE16beta1REL_17_STABLE16beta1REL_16_STABLE16beta1
LLM analysis, 100% suremodified before commitmoderate changesfrom patchset #450 of 1 reviewer saw the final version

The hio.c bulk-extension patch from #45 lands with RelationAddBlocks setting both values of did_unlock and adjusted recheckVmPins initialization. BulkInsertState fields and initialization are also moved here from the sibling page-count patch.

  • Melanie Plagemansaw an earlier versiontrailerShe reviewed the nearby v5 branch implementation and its FSM and BulkInsertState handling #36 #40, before the buffer-lock release and recheck changes in #42.
heapam: Pass number of required pages to RelationGetBufferForTuple()
6 Apr 2023Andres Freundmaster16beta1REL_19_STABLE16beta1REL_18_STABLE16beta1REL_17_STABLE16beta1REL_16_STABLE16beta1
LLM analysis, 100% surepart of a posted patchsetlight changesfrom patchset #451 of 1 reviewer saw the final version

The page-count calculation and RelationGetBufferForTuple parameter from #45 are retained with comment edits. BulkInsertState.next_free/last_free and their initialization are deferred to the subsequent hio.c commit.

  • Melanie Plagemansaw the final versiontrailerHer review of the nearby v5 branch covered heap_multi_insert_pages and recommended moving the unrelated bulk-state fields into their consuming patch #36.
Convert many uses of ReadBuffer[Extended](P_NEW) to ExtendBufferedRel()
6 Apr 2023Andres Freundmaster16beta1REL_19_STABLE16beta1REL_18_STABLE16beta1REL_17_STABLE16beta1REL_16_STABLE16beta1
LLM analysis, 100% suremodified before commitlight changesfrom patchset #450 of 1 reviewer saw the final version

Applying the caller-conversion patch from #45 to the commit parent produces the committed code. Remaining differences are comments in GIN, GiST, and nbtree, including removal or refinement of speculative FIXME notes.

  • Heikki Linnakangassaw an earlier versionLLM analysis, 88% sureHe reviewed the converted extension calls and challenged their verbosity, modes, and fixed-block-number assumptions before the API redesign and additional callers #16.
Use ExtendBufferedRelTo() in {vm,fsm}_extend()
6 Apr 2023Andres Freundmaster16beta1REL_19_STABLE16beta1REL_18_STABLE16beta1REL_17_STABLE16beta1REL_16_STABLE16beta1Also in: pgsql: Don't initialize page in {vm,fsm}_extend(), not needed
LLM analysis, 100% surepart of a posted patchsetlight changesfrom patchset #450 of 1 reviewer saw the final version

The visibilitymap.c and freespace.c changes match their portions of the combined conversion in #45 modulo formatting. The xlogutils.c portion was deliberately committed separately #47.

  • Heikki Linnakangassaw an earlier versionLLM analysis, 96% sureHe proposed extending VM/FSM through the buffer cache and examined how to return the target page, before the final ExtendBufferedRelTo implementation #26 #29.
bufmgr: Introduce infrastructure for faster relation extension
5 Apr 2023Andres Freundmaster16beta1REL_19_STABLE16beta1REL_18_STABLE16beta1REL_17_STABLE16beta1REL_16_STABLE16beta1
LLM analysis, 100% suremodified before commitmoderate changesfrom patchset #450 of 2 reviewers saw the final version

The core extension patch from #45 is retained, with added eb.rel guards around RelationGetSmgr and an EB_SKIP_EXTENSION_LOCK guard on the no-extension unlock path in bufmgr.c. Other differences are formatting, comments, and typedef registration.

  • Heikki Linnakangassaw an earlier versiontrailerHe reviewed the extension API, requested simplification and target-size extension, and discussed locking and recovery use before the substantial interface redesign #16 #26 #32.
  • Melanie Plagemansaw an earlier versiontrailerShe reviewed the nearby v5 branch's extension contracts, assertions, pin handling, and cache flags #36, before the final relation-pointer and unlock guards were added.
bufmgr: Support multiple in-progress IOs by using resowner
5 Apr 2023Andres Freundmaster16beta1REL_19_STABLE16beta1REL_18_STABLE16beta1REL_17_STABLE16beta1REL_16_STABLE16beta1Also in: resowner "cold start" overhead
LLM analysis, 100% surelanded as postedfrom patchset #451 of 1 reviewer saw the final version

Applying the resource-owner buffer-I/O patch from #45 to the commit parent reproduces the committed files modulo whitespace, including AbortBufferIO and ResourceOwner bufferioarr handling.

  • Melanie Plagemansaw the final versiontrailerShe examined I/O ownership, abort cleanup assumptions, and resource-owner conventions in the nearby v5 branch, with no substantive changes to this patch afterward #36 #40.
bufmgr: Acquire and clean victim buffer separately
5 Apr 2023Andres Freundmaster16beta1REL_19_STABLE16beta1REL_18_STABLE16beta1REL_17_STABLE16beta1REL_16_STABLE16beta1
LLM analysis, 100% suremodified before commitmoderate changesfrom patchset #450 of 2 reviewers saw the final version

The victim-buffer separation from #45 lands with an additional StrategyFreeBuffer call when another backend has already installed the requested buffer. Remaining differences in bufmgr.c are comments and formatting.

  • Heikki Linnakangassaw an earlier versiontrailerHe reviewed GetVictimBuffer and InvalidateVictimBuffer, suggesting naming, documentation, atomic-read cleanup, and tracepoint removal before later implementation changes #8.
  • Melanie Plagemansaw an earlier versiontrailerShe reviewed the nearby v5 branch's victim-buffer flow and invalidation comments #36 #40, before the commit added explicit freelist return on mapping collisions.
bufmgr: Add some more error checking [infrastructure] around pinning
5 Apr 2023Andres Freundmaster16beta1REL_19_STABLE16beta1REL_18_STABLE16beta1REL_17_STABLE16beta1REL_16_STABLE16beta1
LLM analysis, 100% surelanded as postedfrom patchset #452 of 2 reviewers saw the final version

Applying the pin-checking patch from #45 yields the committed bufmgr.c and bufmgr.h modulo whitespace, including CheckBufferIsPinnedOnce and the local-buffer assertions.

  • Heikki Linnakangassaw the final versiontrailerHe questioned assertion overhead and accepted the checking approach #7, after which this component received naming and documentation changes.
  • Melanie Plagemansaw the final versiontrailerShe reviewed the nearby v5 branch's pin-checking control flow and naming, leading to the final CheckBufferIsPinnedOnce name and explanatory comments #36 #40.
bufmgr: Add Pin/UnpinLocalBuffer()
5 Apr 2023Andres Freundmaster16beta1REL_19_STABLE16beta1REL_18_STABLE16beta1REL_17_STABLE16beta1REL_16_STABLE16beta1
LLM analysis, 100% surelanded as postedfrom patchset #451 of 2 reviewers saw the final version

The PinLocalBuffer/UnpinLocalBuffer patch in #45 reproduces the committed changes to bufmgr.c, localbuf.c, and buf_internals.h modulo whitespace.

  • Melanie Plagemansaw the final versiontrailerShe reviewed the nearby v5 branch's helper naming and identified the signed-arithmetic problem, whose correction was incorporated into the final helper patch #36 #40.
  • David Rowleysaw an earlier versiontrailerHe examined whether pinning without usage-count adjustment warranted a separate helper #6, before the later arithmetic correction and helper cleanup.
Add smgrzeroextend(), FileZero(), FileFallocate()
5 Apr 2023Andres Freundmaster16beta1REL_19_STABLE16beta1REL_18_STABLE16beta1REL_17_STABLE16beta1REL_16_STABLE16beta1
LLM analysis, 100% surelanded as postedfrom patchset #451 of 5 reviewers saw the final version

The smgrzeroextend, FileZero, and FileFallocate patch from #45 reproduces all six committed source/header files modulo whitespace.

  • Melanie Plagemansaw an earlier versiontrailerShe reviewed the nearby v5 branch's fallocate error handling and proposed simplifying mdzeroextend #36 #40, before the resulting local logic changes.
  • Heikki Linnakangassaw an earlier versiontrailerHe examined smgrzeroextend's use in recovery and VM/FSM extension #23 #26, before FileZero and mdzeroextend were revised.
  • Kyotaro Horiguchisaw an earlier versiontrailerHe reviewed fallocate portability, FileGetRawDesc scope, block limits, and segment arithmetic #37, before the fallback and segment-loop corrections.
  • David Rowleysaw an earlier versiontrailerHe requested return-value documentation and identified the duplicate FileAccess call #6, before the zero-writing implementation and error handling changed.
  • John Naylorsaw the final versiontrailerHe identified the misleading posix_fallocate error text and accepted the replacement FileFallocate wording used in the final patch #43 #46.
Don't initialize page in {vm,fsm}_extend(), not needed
5 Apr 2023Andres Freundmaster16beta1REL_19_STABLE16beta1REL_18_STABLE16beta1REL_17_STABLE16beta1REL_16_STABLE16beta1
LLM analysis, 100% surelanded as postedfrom patchset #45

The removal of eager VM/FSM page initialization and checksumming exactly matches the corresponding patch in #45 modulo whitespace.

bufmgr: Remove buffer-write-dirty tracepoints
4 Apr 2023Andres Freundmaster16beta1REL_19_STABLE16beta1REL_18_STABLE16beta1REL_17_STABLE16beta1REL_16_STABLE16beta1
LLM analysis, 100% suremodified before commitlight changesfrom patchset #421 of 1 reviewer saw the final version

The tracepoint-call and monitoring-documentation removals match #42. The commit additionally removes the two obsolete probe declarations from src/backend/utils/probes.d.

  • Heikki Linnakangassaw the final versionLLM analysis, 99% sureHe explained what the dirty-write probes actually measured and explicitly recommended removing them, which Andres accepted #8 #9.
hio: Release extension lock before initializing page / pinning VM
2 Apr 2023Andres Freundmaster16beta1REL_19_STABLE16beta1REL_18_STABLE16beta1REL_17_STABLE16beta1REL_16_STABLE16beta1
LLM analysis, 100% surelanded as postedfrom patchset #421 of 1 reviewer saw the final version

The hio.c change releasing the extension lock before PageInit and visibilitymap_pin is identical to its latest attached version in #42 modulo whitespace.

  • Heikki Linnakangassaw the final versiontrailerHe said the lock-release patch looked sound and identified redundant page zeroing as a separate improvement #7, with the reviewed code unchanged at landing.
bufmgr: Fix undefined behaviour with, unrealistically, large temp_buffers
30 Mar 2023Andres Freundmaster16beta1REL_19_STABLE16beta1REL_18_STABLE16beta1REL_17_STABLE16beta1REL_16_STABLE16beta1
LLM analysis, 100% surelanded as postedfrom patchset #421 of 1 reviewer saw the final version

The one-line MarkLocalBufferDirty correction from -(buffer + 1) to -buffer - 1 in localbuf.c exactly matches #42.

  • Melanie Plagemansaw the final versionLLM analysis, 97% sureHer review of the nearby v5 branch identified the signed-arithmetic problem and supplied the replacement expression, prompting extraction of this pre-existing-code fix #36 #38 #42.

Nov 2022

1 commit
lwlock: Fix quadratic behavior with very long wait lists
20 Nov 2022Andres Freundmaster16beta1REL_19_STABLE16beta1REL_18_STABLE16beta1REL_17_STABLE16beta1REL_16_STABLE16beta1REL_15_STABLE15.6REL_14_STABLE14.11REL_13_STABLE13.14+1 moreAlso in: heavily contended lwlocks with long wait queues scale badly (modified before commit)

Credits across 17 commits

Author
Andres Freund16 LLM17
Reviewer
Melanie Plageman8
Heikki Linnakangas5
David Rowley2
Alexander Lakhin1
Bharath Rupireddy1
John Naylor1
Kyotaro Horiguchi1
Michael Paquiercommitter1
Reported by
Alexander Lakhin1
Melanie Plageman1
Tom Lane1
Committer
Andres Freund17
Michael Paquier1

N LLM means N of the credits come from LLM analysis, not from commit trailers.