pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Imseih (AWS), Sami <simseih@amazon.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Bossart, Nathan <bossartn@amazon.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Add index scan progress to pg_stat_progress_vacuum
Date: Thu, 5 May 2022 19:26:51 +0000
Message-ID: <422CE0B2-60A7-4E87-B5B1-5393DDF1DA21@amazon.com> (raw)
In-Reply-To: <CAD21AoATKO4Ltizm2CXtggE081tYeJSDWngz0w4w13wTwwCDpA@mail.gmail.com>
References: <DD7EEE19-EFFB-481C-A6EC-26B1E0356F7A@amazon.com>
	<CAD21AoD13LQ4+suYVWCyp07PHgoHVmAPZwc8neNdkTFVsSi-ww@mail.gmail.com>
	<78C9A1C5-8593-47F8-8717-42C554A724E9@amazon.com>
	<CAD21AoAwsaohDMissr_fR_YHp3fzq+eJ4n2=G2Bxji8aMqPAxA@mail.gmail.com>
	<49A92D21-6EBD-45DB-B533-D7EA3F918524@amazon.com>
	<CAD21AoDAj67or-qEMZfdtz74=dgEpt1D=6ZcGJMK8TGvpR38aQ@mail.gmail.com>
	<75570A36-27E0-4128-BB97-FC3CDAE03025@amazon.com>
	<CAD21AoA9Phn9uPtyq_V+J9ctNhkgChnmm_hFT2sA2qR_KcKqYw@mail.gmail.com>
	<3022E190-6FD1-483E-81BC-B03AD396D902@amazon.com>
	<CCF0E7E8-5677-4628-8314-A7727C3E49DA@amazon.com>
	<20220403165002.co5waztdyfkenl56@alap3.anarazel.de>
	<0601FEDE-5DE8-4F03-9F7C-7A927302475C@amazon.com>
	<CA+TgmoaQDGtKs8qotVBHRzr-G5OnrQNdeknAjM_GKdc0J_ideg@mail.gmail.com>
	<399FC5A4-4DF8-4553-9E62-69322DDB63F5@amazon.com>
	<CA069E2B-5A89-43D9-BD5C-B033B7EC32D0@amazon.com>
	<CAD21AoATKO4Ltizm2CXtggE081tYeJSDWngz0w4w13wTwwCDpA@mail.gmail.com>

Thank you for the feedback!

>    I think we can pass the progress update function to
>   WaitForParallelWorkersToFinish(), which seems simpler. And we can call

Directly passing the callback to WaitForParallelWorkersToFinish
will require us to modify the function signature.

To me, it seemed simpler and touches less code to have
the caller set the callback in the ParallelContext.

>    the function after updating the index status to
>    PARALLEL_INDVAC_STATUS_COMPLETED.

I also like this better. Will make the change.

>    BTW, currently we don't need a lock for touching index status since
>    each worker touches different indexes. But after this patch, the
>    leader will touch all index status, do we need a lock for that?

I do not think locking is needed here. The leader and workers
will continue to touch different indexes to update the status.

However, if the process is a leader, it will call the function
which will go through indstats and count how many
Indexes have a status of PARALLEL_INDVAC_STATUS_COMPLETED.
This value is then reported to the leaders backend only.


Regards,

Sami Imseih
Amazon Web Services



view thread (139+ messages)  latest in thread

Message-ID: <422CE0B2-60A7-4E87-B5B1-5393DDF1DA21@amazon.com>
Permalink:  ../422CE0B2-60A7-4E87-B5B1-5393DDF1DA21@amazon.com/
Also on:    postgresql.org/message-id/422CE0B2-60A7-4E87-B5B1-5393DDF1DA21@amazon.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: simseih@amazon.com, sawada.mshk@gmail.com, robertmhaas@gmail.com, bossartn@amazon.com, andres@anarazel.de, pg@bowt.ie, pryzby@telsasoft.com
  Subject: Re: Add index scan progress to pg_stat_progress_vacuum
  In-Reply-To: <422CE0B2-60A7-4E87-B5B1-5393DDF1DA21@amazon.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