pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix past pd_upper write in ginRedoRecompress()
Date: Sun, 09 Sep 2018 18:40:58 +0000
Message-ID: <E1fz4dm-0007Rv-H2@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5f08accdad2b03e0107bdc73d48783a01fe51c8c

Modified Files
--------------
src/backend/access/gin/ginxlog.c | 80 +++++++++++++++++++++++++++++-----------
1 file changed, 59 insertions(+), 21 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1fz4dm-0007Rv-H2@gemulon.postgresql.org>
Permalink:  ../E1fz4dm-0007Rv-H2@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1fz4dm-0007Rv-H2@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: akorotkov@postgresql.org
  Subject: Re: pgsql: Fix past pd_upper write in ginRedoRecompress()
  In-Reply-To: <E1fz4dm-0007Rv-H2@gemulon.postgresql.org>
  References: <E1fz4dm-0007Rv-H2@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox