From: Antonin Houska <ah@cybertec.at>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Sami Imseih <samimseih@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Conflicting updates of command progress
Date: Wed, 23 Apr 2025 12:42:35 +0200
Message-ID: <17871.1745404955@localhost> (raw)
In-Reply-To: <ad3ded83-532e-4c4f-8108-344924c47db0@oss.nttdata.com>
References: <117147.1744380740@localhost>
<CAA5RZ0s_Hta6PWDwY9Lf-c+14F+C13BK2ax=B6R7bmDNhN6xdQ@mail.gmail.com>
<ad3ded83-532e-4c4f-8108-344924c47db0@oss.nttdata.com>
Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
> On 2025/04/15 2:13, Sami Imseih wrote:
> >> While working on [1] I realized that some field of pg_stat_progress_cluste has
> >> weird value.
>
> I ran into the same issue while working on [2], and eventually had to
> withdraw that patch because of it.
Have you considered reporting the progress of each command separately?
I think that can be implemented by moving the progress related fields from
PgBackendStatus into a new structure and by teaching the backend to insert a
new instance of that structure into a shared hash table (dshash.c) whenever a
command that needs progress reporting is being started.
pgstat.c uses such a hash table for various statistics objects, however it's
probably not a good idea to adjust this infrastructure by simply adding a new
object kind (e.g. PGSTAT_KIND_COMMAND). I think that pgstat.c is designed for
frequent updates of backend-local statistics and less frequent flushes
(e.g. at command completion) to the shared memory. That's not suitable for
progress reporting.
> [2] https://commitfest.postgresql.org/patch/5282/
--
Antonin Houska
Web: https://www.cybertec-postgresql.com
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: ah@cybertec.at, masao.fujii@oss.nttdata.com, samimseih@gmail.com
Subject: Re: Conflicting updates of command progress
In-Reply-To: <17871.1745404955@localhost>
* 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