Re: Conflicting updates of command progress - Mailing list pgsql-hackers

From Sami Imseih
Subject Re: Conflicting updates of command progress
Date
Msg-id CAA5RZ0s_Hta6PWDwY9Lf-c+14F+C13BK2ax=B6R7bmDNhN6xdQ@mail.gmail.com
Whole thread Raw
In response to Conflicting updates of command progress  (Antonin Houska <ah@cybertec.at>)
Responses Re: Conflicting updates of command progress
List pgsql-hackers
> While working on [1] I realized that some field of pg_stat_progress_cluste has
> weird value.

Is there a repro that you can share that shows the weird values? It sounds like
the repro is on top of [1]. Is that right?

> AFAICS the current design does not consider that one progress-reporting
> command can be called by another one.

pgstat_progress_start_command should only be called once by the entry
point for the
command. In theory, we could end up in a situation where start_command
is called multiple times during the same top-level command;

> Not sure what the correct fix is. We can
> either ignore update requests from the "nested" commands, or display the

There is a pattern where we do

```
if (progress)
      pgstat_progress_update_param
```

cluster_rel can pass down a flag to index_build or others that update progress
to not report progress. Therefore, only the top level command is
updating progress.
what do you think?


[1] https://commitfest.postgresql.org/patch/5117/

--
Sami Imseih
Amazon Web Services (AWS)



pgsql-hackers by date:

Previous
From: Wolfgang Walther
Date:
Subject: Re: [PoC] Federated Authn/z with OAUTHBEARER
Next
From: Tom Lane
Date:
Subject: Re: not null constraints, again