Re: Add index scan progress to pg_stat_progress_vacuum

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: "Imseih (AWS), Sami" <simseih(at)amazon(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Subject: Re: Add index scan progress to pg_stat_progress_vacuum
Date: 2022-04-05 17:19:04
Message-ID: CA+TgmoaQDGtKs8qotVBHRzr-G5OnrQNdeknAjM_GKdc0J_ideg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 5, 2022 at 12:42 PM Imseih (AWS), Sami <simseih(at)amazon(dot)com> wrote:
> > Why isn't the obvious thing to do here to provide a way to associate workers
> > with their leaders in shared memory, but to use the existing progress fields
> > to report progress? Then, when querying progress, the leader and workers
> > progress fields can be combined to show the overall progress?
>
> The original intent was this, however the workers
> can exit before the command completes and the
> worker progress data will be lost.
> This is why the shared memory was introduced.
> This allows the worker progress to persist for the duration
> of the command.

At the beginning of a parallel operation, we allocate a chunk of
dynamic shared memory which persists even after some or all workers
have exited. It's only torn down at the end of the parallel operation.
That seems like the appropriate place to be storing any kind of data
that needs to be propagated between parallel workers. The current
patch uses the main shared memory segment, which seems unacceptable to
me.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-04-05 17:30:06 Re: shared-memory based stats collector - v68
Previous Message Stephen Frost 2022-04-05 17:10:38 Re: Improve documentation for pg_upgrade, standbys and rsync