Re: Allow progress tracking of sub-commands

From: Manu <manuelreyesbravo(at)gmail(dot)com>
To: Antonin Houska <ah(at)cybertec(dot)at>
Cc: Alberto Piai <alberto(dot)piai(at)gmail(dot)com>, Rahila Syed <rahilasyed90(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, alvherre(at)kurilemu(dot)de, pgsql-hackers(at)lists(dot)postgresql(dot)org, bharath(dot)rupireddyforpostgres(at)gmail(dot)com, mihailnikalayeu(at)gmail(dot)com, adam8157(at)gmail(dot)com
Subject: Re: Allow progress tracking of sub-commands
Date: 2026-11-27 21:37:39
Message-ID: 179581545943.543733.11015024819967370487@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Antonin,

The dummy command works: with v06-0001 alone, case 2 keeps the
COPY's row. But with 0002 applied as well it is still lost, the
same as on v05 and master. Tested on master 9ebc9a458c3.

> v06 fixes this too (hopefully it doesn't break the previous fixes).

The script from my last mail gives 1, 1 and 1 rows in
pg_stat_progress_copy with v06-0001 alone, but 1, 0 and 0 with
0001 and 0002, as before.

With two file_fdw scans in the trigger's query,
fileBeginForeignScan() turns pgstat_track_progress off, so neither
inner COPY is pushed. But fileEndForeignScan() turns it back on
before EndCopyFrom(), so the first inner COPY's
pgstat_progress_end_command() runs, finds no parent and ends the
outer COPY. Resuming after EndCopyFrom() would avoid that, but
since 0001 now keeps the outer row by itself here, maybe 0002 can
rely on the dummy command too.

The previous fixes hold: the other deterministic cases give the same
output as on v05, and nothing crashed or failed an assertion.

Regards,
Manu

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Osama Abdul Qader 2026-11-27 22:13:24 Re: pg_rewind reports "no rewind required" due to stale minRecoveryPoint
Previous Message Heikki Linnakangas 2026-11-27 20:44:07 Re: Interrupts vs signals