pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: Andres Freund <andres@anarazel.de>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Cc: Petr Jelinek <petr.jelinek@2ndquadrant.com>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] Logical decoding of TRUNCATE
Date: Wed, 23 Dec 2020 18:58:36 -0800
Message-ID: <20201224025836.GA4158910@rfd.leadboat.com> (raw)
In-Reply-To: <20201221174247.67pnoem5dtscocv4@alap3.anarazel.de>
References: <20180405170712.av633jvnnizmd5sn@alvherre.pgsql>
	<1baed811-47b2-5b7d-c641-4b7eb01d650f@2ndquadrant.com>
	<20201220041319.GA3602688@rfd.leadboat.com>
	<20201220231308.yi4t3xj2btpanxs5@alap3.anarazel.de>
	<CAH2-WzkKTQVWhz7ZEJKiv7c4emgAzPKL92ag64kZdbh2YKgDkw@mail.gmail.com>
	<20201221174247.67pnoem5dtscocv4@alap3.anarazel.de>

On Mon, Dec 21, 2020 at 09:42:47AM -0800, Andres Freund wrote:
> On 2020-12-20 15:54:31 -0800, Peter Geoghegan wrote:
> > On Sun, Dec 20, 2020 at 3:13 PM Andres Freund <andres@anarazel.de> wrote:
> > > Hm. Do I understand correctly that this problem is hit solely because
> > > the parallel mode code relies on there already have been a transaction
> > > snapshot set, thus avoiding the error? And that the code normally only
> > > works because GetTransactionSnapshot() will already have been called
> > > somewhere, before EnterParallelMode()?
> > 
> > It seems unlikely that InitializeParallelDSM() was ever intended to be
> > run in a background worker.
> 
> IDK, the environment in a bgworker shouldn't be that different from the
> normal query environment in a normal connection. And it's far from
> insane to want to be able to run a paralell query in a bgworker (and I
> *think* I have seen that work before). This case here seems more like
> an accidental dependency than anything to me, once that could perhaps
> even hint at problems in normal backends too.

Yeah.  SPI_execute("TRUNCATE foo", false, 0) has no trouble doing a parallel
index build in a bgworker.  Let's ignore intention and be pleased about that.





view thread (48+ messages)

Message-ID: <20201224025836.GA4158910@rfd.leadboat.com>
Permalink:  ../20201224025836.GA4158910@rfd.leadboat.com/
Also on:    postgresql.org/message-id/20201224025836.GA4158910@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 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-general@postgresql.org
  Cc: noah@leadboat.com, andres@anarazel.de, pg@bowt.ie, robertmhaas@gmail.com, peter.eisentraut@2ndquadrant.com, alvherre@alvh.no-ip.org, marco.nenciarini@2ndquadrant.it, petr.jelinek@2ndquadrant.com, thomas.munro@enterprisedb.com, simon@2ndquadrant.com, pgsql-hackers@postgresql.org
  Subject: Re: [PATCH] Logical decoding of TRUNCATE
  In-Reply-To: <20201224025836.GA4158910@rfd.leadboat.com>
  References: <20180405170712.av633jvnnizmd5sn@alvherre.pgsql> <1baed811-47b2-5b7d-c641-4b7eb01d650f@2ndquadrant.com> <20201220041319.GA3602688@rfd.leadboat.com> <20201220231308.yi4t3xj2btpanxs5@alap3.anarazel.de> <CAH2-WzkKTQVWhz7ZEJKiv7c4emgAzPKL92ag64kZdbh2YKgDkw@mail.gmail.com> <20201221174247.67pnoem5dtscocv4@alap3.anarazel.de> <20201224025836.GA4158910@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