pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Maintain valid md.c state when FileClose() fails.
Date: Sat, 11 Jan 2020 02:34:27 +0000
Message-ID: <E1iq6bb-0005If-5p@gemulon.postgresql.org> (raw)

Maintain valid md.c state when FileClose() fails.

FileClose() failure ordinarily causes a PANIC.  Suppose the user
disables that PANIC via data_sync_retry=on.  After mdclose() issued a
FileClose() that failed, calls into md.c raised SIGSEGV.  This fix adds
repalloc() calls during mdclose(); update a comment about ignoring
repalloc() cost.  The rate of relation segment count change is a minor
factor; more relevant to overall performance is the rate of mdclose()
and subsequent re-opening of segments.  Back-patch to v10, where commit
45e191e3aa62d47a8bc1a33f784286b2051f45cb introduced the bug.

Reviewed by Kyotaro Horiguchi.

Discussion: https://postgr.es/m/20191222091930.GA1280238@rfd.leadboat.com

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/93078e63f77979df3752e8ef5392dd384117e0ef

Modified Files
--------------
src/backend/storage/smgr/md.c | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1iq6bb-0005If-5p@gemulon.postgresql.org>
Permalink:  ../E1iq6bb-0005If-5p@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iq6bb-0005If-5p@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: noah@leadboat.com
  Subject: Re: pgsql: Maintain valid md.c state when FileClose() fails.
  In-Reply-To: <E1iq6bb-0005If-5p@gemulon.postgresql.org>
  References: <E1iq6bb-0005If-5p@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