]> granicus.if.org Git - postgresql/commit
Fix rare dsa_allocate() failures due to freepage.c corruption.
authorThomas Munro <tmunro@postgresql.org>
Wed, 13 Feb 2019 00:14:10 +0000 (13:14 +1300)
committerThomas Munro <tmunro@postgresql.org>
Wed, 13 Feb 2019 00:32:05 +0000 (13:32 +1300)
commit2cfdf24e7c6867c768999ccd809a32d53d226d82
tree39a0b266152289825bf39a0e0956b8a8af7cbd81
parentf5f9a760a3bc2be95f8716e476150ce128efa22b
Fix rare dsa_allocate() failures due to freepage.c corruption.

In a corner case, a btree page was allocated during a clean-up operation
that could cause the tracking of the largest contiguous span of free
space to get out of whack.  That was supposed to be prevented by the use
of the "soft" flag to avoid allocating internal pages during incidental
clean-up work, but the flag was ignored in the case where the FPM was
promoted from singleton format to btree format.  Repair.

Remove an obsolete comment in passing.

Back-patch to 10, where freepage.c arrived (as support for dsa.c).

Author: Robert Haas
Diagnosed-by: Thomas Munro and Robert Haas
Reported-by: Justin Pryzby, Rick Otten, Sand Stone, Arne Roland and others
Discussion: https://postgr.es/m/CAMAYy4%2Bw3NTBM5JLWFi8twhWK4%3Dk_5L4nV5%2BbYDSPu8r4b97Zg%40mail.gmail.com
src/backend/utils/mmgr/freepage.c