Re: adding status for COPY progress report - Mailing list pgsql-hackers

From Matthias van de Meent
Subject Re: adding status for COPY progress report
Date
Msg-id CAEze2WgqT3gqj8GfFn6BkibKJhDi=kqxMin8uRnO3-EseW-nFw@mail.gmail.com
Whole thread Raw
In response to adding status for COPY progress report  (Zhihong Yu <zyu@yugabyte.com>)
Responses Re: adding status for COPY progress report  (Zhihong Yu <zyu@yugabyte.com>)
List pgsql-hackers
On Tue, 24 May 2022 at 19:13, Zhihong Yu <zyu@yugabyte.com> wrote:
>
> Hi,
> Please see attached for enhancement to COPY command progress.
>
> The added status column would allow users to get the status of the most recent COPY command.

I fail to see the merit of retaining completed progress reporting
commands in their views after completion, other than making the
behaviour of the pg_stat_progress-views much more complicated and
adding overhead in places where we want the system to have as little
overhead as possible.

Trying to get the status of a COPY command after it finished on a
different connection seems weird, as that other connection is likely
to have already disconnected / started another task. To be certain
that a backend can see the return status of the COPY command, you'd
have to be certain that the connection doesn't run any other
_progress-able commands in the following seconds / minutes, which
implies control over the connection, which means you already have
access to the resulting status of your COPY command.

Regarding the patch: I really do not like that this leaks entries into
all _progress views: I get garbage data from e.g. the _create_index
and _copy views when VACUUM is running, etc, because you removed the
filter on cmdtype.
Also, the added fields in CopyToStateData / CopyFromStateData seem
useless when a pgstat_progress_update_param in the right place should
suffice.

Kind regards,

Matthias van de Meent



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: ccache, MSVC, and meson
Next
From: Justin Pryzby
Date:
Subject: Re: ccache, MSVC, and meson