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

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(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-02-04 06:59:46
Message-ID: CA+HiwqFv0MwXeRS0zRq8G+q_9wmfN_mLcvTHxWM2N3V+y_9SUw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 4, 2020 at 10:34 AM Amit Langote <amitlangote09(at)gmail(dot)com> wrote:
> Reading this:
>
> + <entry><structfield>backup_total</structfield></entry>
> + <entry><type>bigint</type></entry>
> + <entry>
> + Total amount of data that will be streamed. If progress reporting
> + is not enabled in <application>pg_basebackup</application>
> + (i.e., <literal>--progress</literal> option is not specified),
> + this is <literal>0</literal>.
>
> I wonder how hard would it be to change basebackup.c to always set
> backup_total, irrespective of whether --progress is specified with
> pg_basebackup or not? It seems quite misleading to leave it set to 0,
> because one may panic that they have lost their data, that is, if they
> haven't first read the documentation.

For example, the attached patch changes basebackup.c to always set
tablespaceinfo.size, irrespective of whether --progress was passed
with BASE_BACKUP command. It passes make check-world, so maybe safe.
Maybe it would be a good idea to add a couple of more comments around
tablespaceinfo struct definition, such as how 'size' is to be
interpreted.

Thanks,
Amit

Attachment Content-Type Size
basebackup-always-set-tablespace-size.patch text/plain 3.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-02-04 08:15:03 Refactor compile-time assertion checks for C/C++
Previous Message Amit Kapila 2020-02-04 06:41:31 Re: ERROR: subtransaction logged without previous top-level txn record