]> granicus.if.org Git - postgresql/commit
Fix past pd_upper write in ginRedoRecompress()
authorAlexander Korotkov <akorotkov@postgresql.org>
Sun, 9 Sep 2018 18:19:29 +0000 (21:19 +0300)
committerAlexander Korotkov <akorotkov@postgresql.org>
Sun, 9 Sep 2018 18:19:29 +0000 (21:19 +0300)
commit5f08accdad2b03e0107bdc73d48783a01fe51c8c
tree8fc9e97dd97441314b4cbb917ab36fcf2ec469e8
parentff47d4bf1f208227a2e087ef7269e88285fa257e
Fix past pd_upper write in ginRedoRecompress()

ginRedoRecompress() replays actions over compressed segments of posting list
in-place.  However, it might lead to write past pg_upper, because intermediate
state during playing the changes can take more space than both original state
and final state.  This commit fixes that by refuse from in-place modification.
Instead page tail is copied once modification is started, and then it's used
as the source of original segments.  Backpatch to 9.4 where posting list
compression was introduced.

Reported-by: Sivasubramanian Ramasubramanian
Discussion: https://postgr.es/m/1536091151804.6588%40amazon.com
Author: Alexander Korotkov based on patch from and ideas by Sivasubramanian Ramasubramanian
Review: Sivasubramanian Ramasubramanian
Backpatch-through: 9.4
src/backend/access/gin/ginxlog.c