Re: pgstat_report_activity() and parallel CREATE INDEX (was: Parallel index creation & pg_stat_activity)
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Noah Misch <noah@leadboat.com>
Cc: Peter Geoghegan <pg@bowt.ie>, Andres Freund <andres@anarazel.de>,
Phil Florent <philflorent@hotmail.com>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2020-10-25T14:52:50Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Set debug_query_string in worker_spi.
- d2246cde825e 14.0 landed
-
Reproduce debug_query_string==NULL on parallel workers.
- 045466675820 11.10 landed
- 741b84e9f747 12.5 landed
- ab2e2ce46668 13.1 landed
- f90e80b91383 14.0 landed
-
Logical replication support for TRUNCATE
- 039eb6e92f20 11.0 cited
-
Call pgstat_report_activity() in parallel CREATE INDEX workers.
- 7de4a1bcc56f 11.0 landed
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