pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: tgl@sss.pgh.pa.us
Cc: pryzby@telsasoft.com
Cc: pgsql-hackers@postgresql.org
Subject: Re: v13: CLUSTER segv with wal_level=minimal and parallel index creation
Date: Mon, 7 Sep 2020 02:32:55 -0700
Message-ID: <20200907093255.GA3609623@rfd.leadboat.com> (raw)
In-Reply-To: <20200907.174036.603784943439284546.horikyota.ntt@gmail.com>
References: <20200907033451.GB7158@telsasoft.com>
	<1625111.1599453183@sss.pgh.pa.us>
	<20200907.134528.1788420979518620237.horikyota.ntt@gmail.com>
	<20200907.174036.603784943439284546.horikyota.ntt@gmail.com>

On Mon, Sep 07, 2020 at 05:40:36PM +0900, Kyotaro Horiguchi wrote:
> At Mon, 07 Sep 2020 13:45:28 +0900 (JST), Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote in 
> > The cause is that the worker had received pending-sync entry correctly
> > but not never created a relcache entry for the relation using
> > RelationBuildDesc. So the rd_firstRelfilenodeSubid is not correctly
> > set.
> > 
> > I'm investigating it.
> 
> Relcaches are loaded from a file with old content at parallel worker
> startup. The relcache entry is corrected by invalidation at taking a
> lock but pending syncs are not considered.
> 
> Since parallel workers don't access the files so we can just ignore
> the assertion safely, but I want to rd_firstRelfilenodeSubid flag at
> invalidation, as attached PoC patch.

> [patch: When RelationInitPhysicalAddr() handles a mapped relation, re-fill
> rd_firstRelfilenodeSubid from RelFileNodeSkippingWAL(), like
> RelationBuildDesc() would do.]

As a PoC, this looks promising.  Thanks.  Would you add a test case such that
the following demonstrates the bug in the absence of your PoC?

  printf '%s\n%s\n%s\n' 'log_statement = all' 'wal_level = minimal' 'max_wal_senders = 0' >/tmp/minimal.conf
  make check TEMP_CONFIG=/tmp/minimal.conf

Please have the test try both a nailed-and-mapped relation and a "nailed, but
not mapped" relation.  I am fairly confident that your PoC fixes the former
case, but the latter may need additional code.





view thread (13+ messages)  latest in thread

Message-ID: <20200907093255.GA3609623@rfd.leadboat.com>
Permalink:  ../20200907093255.GA3609623@rfd.leadboat.com/
Also on:    postgresql.org/message-id/20200907093255.GA3609623@rfd.leadboat.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: noah@leadboat.com, horikyota.ntt@gmail.com, tgl@sss.pgh.pa.us, pryzby@telsasoft.com
  Subject: Re: v13: CLUSTER segv with wal_level=minimal and parallel index creation
  In-Reply-To: <20200907093255.GA3609623@rfd.leadboat.com>

* 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