Manu <[email protected]> wrote:

> v07 fixes case 2: the script from my last mail now gives 1, 1 and 1 rows,
> and the earlier cases still pass.  But in 0002, nodes is counted when the
> plan is made and nodes_ended when the scans end, and the two counts can
> drift apart.  When they do, progress reporting stays off for the rest of the
> session,

I thought about this, but haven't figured out particular case where it can
really happen.

> CREATE INDEX included.  Tested on master 9ebc9a458c3.

How does CREATE INDEX relate to FDW?

> The cases below use ft and ft2, file_fdw tables over seq 1000, and

...

I've decided to disable progress reporting by COPY FROM whenever it's launched
from file_fdw, regardless the number of nodes. The commit message of 0002
explains why.

> One point from my mail to Alberto on 25-11 is still open in v07, and
> it is not only about readers.  With another session holding an
> uncommitted INSERT, REINDEX INDEX CONCURRENTLY shows command NULL and
> index_relid 0 while it waits for writers, where master shows REINDEX
> CONCURRENTLY and the index.  The waits in phases 2, 3 and 5 start a
> new command and set only the phase.  Any table with writes waits
> there.

Indeed, the parameter PROGRESS_CREATEIDX_COMMAND wasn't always set. Fixed in
v08.

> Alberto's suggestion, updating the phase of the current command, would avoid
> it.

In [1] Alberto deals with ReindexRelationConcurrently(). Why is it wrong to
call pgstat_progress_start_command() for each index? This is actually what
master does. What I had to do is making the _start_command() / _end_command()
calls balanced.

[1]
https://www.postgresql.org/message-id/DN49WENZXU2W.NZRYHQWDF8ED%40gmail.com


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

Attachment: v08-0001-Allow-progress-tracking-of-sub-commands.patch
Description: application/mbox

Attachment: v08-0002-Disable-progress-reporting-in-file_fdw.patch
Description: application/mbox

Reply via email to