public inbox for [email protected]  
help / color / mirror / Atom feed
From: Antonin Houska <[email protected]>
To: Sami Imseih <[email protected]>
Cc: [email protected]
Subject: Re: Conflicting updates of command progress
Date: Fri, 25 Apr 2025 19:34:48 +0200
Message-ID: <25940.1745602488@localhost> (raw)
In-Reply-To: <CAA5RZ0vg3jAJSjQDZZdjz--sJCh0v1MVZ5Lpqh4F=Rn8vnVjOw@mail.gmail.com>
References: <117147.1744380740@localhost>
	<CAA5RZ0s_Hta6PWDwY9Lf-c+14F+C13BK2ax=B6R7bmDNhN6xdQ@mail.gmail.com>
	<17632.1745403972@localhost>
	<CAA5RZ0v5tYwsdSxQaFUh0xkHPnY62m55qZ=a7k6EewbP-zCMvA@mail.gmail.com>
	<4746.1745487225@localhost>
	<CAA5RZ0vg3jAJSjQDZZdjz--sJCh0v1MVZ5Lpqh4F=Rn8vnVjOw@mail.gmail.com>

Sami Imseih <[email protected]> wrote:

> > pgstat_progress_start_command() is called twice: First with
> > cmdtype=PROGRESS_COMMAND_CLUSTER, second with
> > PROGRESS_COMMAND_CREATE_INDEX. The first happens in cluster_rel() the second
> > in cluster_rel() -> rebuild_relation() -> finish_heap_swap() ->
> > reindex_relation() -> reindex_index().
> >
> > It does not matter though, the current design only expects one command.
> 
> When I set a breakpoint on pgstat_progress_start_command and ran a
> CLUSTER on a table with a few indexes, I only saw start_command being
> called once for PROGRESS_COMMAND_CLUSTER. Then I went back in the
> code and realized that reindex_index when called via the CLUSTER command
> has progress set to false. So as it stands now, only PROGRESS_COMMAND_CLUSTER
> is effectively started when CLUSTER is called.
> 
> ```
> if (progress)
> {
> const int progress_cols[] = {
> PROGRESS_CREATEIDX_COMMAND,
> PROGRESS_CREATEIDX_INDEX_OID
> };
> const int64 progress_vals[] = {
> PROGRESS_CREATEIDX_COMMAND_REINDEX,
> indexId
> };
> 
> pgstat_progress_start_command(PROGRESS_COMMAND_CREATE_INDEX,
> heapId);
> pgstat_progress_update_multi_param(2, progress_cols, progress_vals);
> }

Ah, got it. So for now the REPACK CONCURRENTLY patch only needs to turn off
the progress reporting for PROGRESS_COMMAND_CREATE_INDEX properly. Thanks for
checking!

-- 
Antonin Houska
Web: https://www.cybertec-postgresql.com






view thread (10+ messages)

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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Conflicting updates of command progress
  In-Reply-To: <25940.1745602488@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox