]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Unpin buffer before inplace update waits for an XID to end.
authorNoah Misch <noah@leadboat.com>
Tue, 29 Oct 2024 16:39:55 +0000 (09:39 -0700)
committerNoah Misch <noah@leadboat.com>
Tue, 29 Oct 2024 16:40:00 +0000 (09:40 -0700)
commitc2139db11b161096c9d65a0fa7c1a8a3227ea856
tree8ba305f45f9292a5eff50d9ff6ef6229ceb931ec
parent8f1759c9b4ee8e69ee6630d7f8f1be1e2876f36e
Unpin buffer before inplace update waits for an XID to end.

Commit a07e03fd8fa7daf4d1356f7cb501ffe784ea6257 changed inplace updates
to wait for heap_update() commands like GRANT TABLE and GRANT DATABASE.
By keeping the pin during that wait, a sequence of autovacuum workers
and an uncommitted GRANT starved one foreground LockBufferForCleanup()
for six minutes, on buildfarm member sarus.  Prevent, at the cost of a
bit of complexity.  Back-patch to v12, like the earlier commit.  That
commit and heap_inplace_lock() have not yet appeared in any release.

Discussion: https://postgr.es/m/20241026184936.ae.nmisch@google.com
src/backend/access/heap/heapam.c
src/backend/access/index/genam.c
src/include/access/heapam.h