Re: pg_stat_progress_basebackup - progress reporting for pg_basebackup, in the server side

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Amit Langote <amitlangote09(at)gmail(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, "Shinoda, Noriyoshi (PN Japan A&PS Delivery)" <noriyoshi(dot)shinoda(at)hpe(dot)com>, Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat_progress_basebackup - progress reporting for pg_basebackup, in the server side
Date: 2020-03-18 16:22:00
Message-ID: CABUevEwfkipuK=wGCZXzppsZc18rV_DvK3fxaLQ=6OmY_wMJ=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 18, 2020 at 5:14 PM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote:
>
>
>
> On 2020/03/19 0:37, Magnus Hagander wrote:
> > On Wed, Mar 11, 2020 at 5:53 AM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote:
> >>
> >>
> >>
> >> On 2020/03/11 3:39, Magnus Hagander wrote:
> >>> On Tue, Mar 10, 2020 at 6:19 PM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote:
> >>>>
> >>>>
> >>>>
> >>>> On 2020/03/10 22:43, Amit Langote wrote:
> >>>>> On Tue, Mar 10, 2020 at 6:09 PM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote:
> >>>>>>> So, I will make the patch adding support for --no-estimate-size option
> >>>>>>> in pg_basebackup.
> >>>>>>
> >>>>>> Patch attached.
> >>>>>
> >>>>> Like the idea and the patch looks mostly good.
> >>>>
> >>>> Thanks for reviewing the patch!
> >>>>
> >>>>> + total size. If the estimation is disabled in
> >>>>> + <application>pg_basebackup</application>
> >>>>> + (i.e., <literal>--no-estimate-size</literal> option is specified),
> >>>>> + this is always <literal>0</literal>.
> >>>>>
> >>>>> "always" seems unnecessary.
> >>>>
> >>>> Fixed.
> >>>>
> >>>>> + This option prevents the server from estimating the total
> >>>>> + amount of backup data that will be streamed. In other words,
> >>>>> + <literal>backup_total</literal> column in the
> >>>>> + <structname>pg_stat_progress_basebackup</structname>
> >>>>> + view always indicates <literal>0</literal> if this option is enabled.
> >>>>>
> >>>>> Here too.
> >>>>
> >>>> Fixed.
> >>>>
> >>>> Attached is the updated version of the patch.
> >>>
> >>> Would it perhaps be better to return NULL instead of 0 in the
> >>> statistics view if there is no data?
> >
> > Did you miss this comment, or not agree? :)
>
> Oh, I forgot to attached the patch... Patch attached.
> This patch needs to be applied after applying
> add_no_estimate_size_v3.patch.

:)

Hmm. I'm slightly irked by doing the -1 -> NULL conversion in the SQL
view. I wonder if it might be worth teaching
pg_stat_get_progress_info() about returning NULL?

--
Magnus Hagander
Me: https://www.hagander.net/
Work: https://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2020-03-18 16:24:45 Re: Small docs bugfix: make it clear what can be used in UPDATE FROM and DELETE USING
Previous Message Tom Lane 2020-03-18 16:14:50 Re: proposal: new polymorphic types - commontype and commontypearray