pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Don't use _mdfd_getseg() in mdsyncfiletag().
Date: Sat, 14 Dec 2019 03:48:12 +0000
Message-ID: <E1ifyPc-0007cY-9S@gemulon.postgresql.org> (raw)

Don't use _mdfd_getseg() in mdsyncfiletag().

_mdfd_getseg() opens all segments up to the requested one.  That
causes problems for mdsyncfiletag(), if mdunlinkfork() has
already unlinked other segment files.  Open the file we want
directly by name instead, if it's not already open.

The consequence of this bug was a rare panic in the checkpointer,
made more likely if you saturated the sync request queue so that
the SYNC_FORGET_REQUEST messages for a given relation were more
likely to be absorbed in separate cycles by the checkpointer.

Back-patch to 12.  Defect in commit 3eb77eba.

Author: Thomas Munro
Reported-by: Justin Pryzby
Discussion: https://postgr.es/m/20191119115759.GI30362%40telsasoft.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7bb3102cea02101efcbb4c4fba3fdd452a52bdab

Modified Files
--------------
src/backend/storage/smgr/md.c | 57 ++++++++++++++++++++++++++++++-------------
1 file changed, 40 insertions(+), 17 deletions(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1ifyPc-0007cY-9S@gemulon.postgresql.org>
Permalink:  ../E1ifyPc-0007cY-9S@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ifyPc-0007cY-9S@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: tmunro@postgresql.org
  Subject: Re: pgsql: Don't use _mdfd_getseg() in mdsyncfiletag().
  In-Reply-To: <E1ifyPc-0007cY-9S@gemulon.postgresql.org>
  References: <E1ifyPc-0007cY-9S@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