pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Noah Misch <noah@leadboat.com>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: Andres Freund <andres@anarazel.de>
Cc: Phil Florent <philflorent@hotmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: pgstat_report_activity() and parallel CREATE INDEX (was: Parallel index creation & pg_stat_activity)
Date: Sun, 25 Oct 2020 10:52:50 -0400
Message-ID: <439665.1603637570@sss.pgh.pa.us> (raw)
In-Reply-To: <20201025051836.GC2651494@rfd.leadboat.com>
References: <CAH2-WzkryAPcQOHBJKuDKfni-HGFny31yjcbM-yp5HO-71iCdw@mail.gmail.com>
	<CAH2-Wzmf-34hD4n40uTuE-ZY9P5c+mvhFbCdQfN=KrKiVm3j3A@mail.gmail.com>
	<20201014022636.GA1962668@rfd.leadboat.com>
	<CAH2-Wzm2K3jqurvFfCXsV=s+NvPf9V=6YDDcVPk-0kORL9D7oA@mail.gmail.com>
	<20201025051836.GC2651494@rfd.leadboat.com>

Noah Misch <noah@leadboat.com> writes:
> On Sat, Oct 17, 2020 at 08:39:35AM -0700, Peter Geoghegan wrote:
>> I also prefer 2.

> Thanks.  Here is the pair of patches I plan to use.  The second is equivalent
> to v0; I just added a log message.

The change in worker_spi_main seems a little weird/lazy.  I'd
be inclined to set and clear debug_query_string each time through
the loop, so that those operations are adjacent to the other
status-reporting operations, as they are in initialize_worker_spi.

I don't really like modifying a StringInfo while debug_query_string
is pointing at it, either.  Yeah, you'll *probably* get away with
that because the buffer is unlikely to move, but since the whole
exercise can only benefit crash-debugging scenarios, it'd be better
to be more paranoid.

One idea is to set debug_query_string immediately before each SPI_execute
and clear it just afterwards, rather than trying to associate it with
pgstat_report_activity calls.

			regards, tom lane





view thread (10+ messages)  latest in thread

Message-ID: <439665.1603637570@sss.pgh.pa.us>
Permalink:  ../439665.1603637570@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/439665.1603637570@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, noah@leadboat.com, pg@bowt.ie, andres@anarazel.de, philflorent@hotmail.com
  Subject: Re: pgstat_report_activity() and parallel CREATE INDEX (was: Parallel index creation & pg_stat_activity)
  In-Reply-To: <439665.1603637570@sss.pgh.pa.us>

* 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