pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Check for interrupts inside the nbtree page deletion code.
Date: Wed, 04 Jul 2018 23:07:02 +0000
Message-ID: <E1faqrW-0004kw-SW@gemulon.postgresql.org> (raw)

Check for interrupts inside the nbtree page deletion code.

When deleting pages the nbtree code has to walk through siblings of a
tree node. When those sibling links are corrupted that can lead to
endless loops - which are currently not interruptible.  This is
especially problematic if autovacuum is repeatedly blocked on such
indexes, as it can be hard to get out of that situation without
resorting to single user mode.

Thus add interrupt checks to appropriate places in such
loops. Unfortunately in one of the cases it's it's not easy to do so.

Between 9.3 and 9.4 the page deletion (and page split) code changed
significantly. Before it was significantly less robust against
interruptions. Therefore don't backpatch to 9.3.

Author: Andres Freund
Discussion: https://postgr.es/m/20180627191629.wkunw2qbibnvlz53@alap3.anarazel.de
Backpatch: 9.4-

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3a01f68e35a3584431ac5381c6ed75b1b39aaf2a

Modified Files
--------------
src/backend/access/nbtree/nbtpage.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)



view thread (6+ messages)  latest in thread

Message-ID: <E1faqrW-0004kw-SW@gemulon.postgresql.org>
Permalink:  ../E1faqrW-0004kw-SW@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1faqrW-0004kw-SW@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: andres@anarazel.de
  Subject: Re: pgsql: Check for interrupts inside the nbtree page deletion code.
  In-Reply-To: <E1faqrW-0004kw-SW@gemulon.postgresql.org>
  References: <E1faqrW-0004kw-SW@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