pgsql: Adjust total size in pg_basebackup progress report when reality

Started by Magnus Haganderover 14 years ago3 messages
#1Magnus Hagander
magnus@hagander.net

Adjust total size in pg_basebackup progress report when reality changes

When streaming including WAL, the size estimate will always be incorrect,
since we don't know how much WAL is included. To make sure the output doesn't
look completely unreasonable, this patch increases the total size whenever we
go past the estimate, to make sure we never go above 100%.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/1bb69245ab234634013c543927e6fa76009622fa

Modified Files
--------------
src/bin/pg_basebackup/pg_basebackup.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

#2Fujii Masao
masao.fujii@gmail.com
In reply to: Magnus Hagander (#1)
Re: [COMMITTERS] pgsql: Adjust total size in pg_basebackup progress report when reality

On Wed, Aug 17, 2011 at 12:00 AM, Magnus Hagander <magnus@hagander.net> wrote:

Adjust total size in pg_basebackup progress report when reality changes

When streaming including WAL, the size estimate will always be incorrect,
since we don't know how much WAL is included. To make sure the output doesn't
look completely unreasonable, this patch increases the total size whenever we
go past the estimate, to make sure we never go above 100%.

http://developer.postgresql.org/pgdocs/postgres/app-pgbasebackup.html
----------------
Enables progress reporting. Turning this on will deliver an approximate progress
report during the backup. Since the database may change during the backup,
this is only an approximation and may not end at exactly 100%. In particular,
when WAL log is included in the backup, the total amount of data cannot be
estimated in advance, and in this case the progress report will only count
towards the total amount of data without WAL.
----------------

ISTM that the last sentence needs to be changed slightly because this commit
changed the total amount so that it contains the amount of WAL.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

#3Magnus Hagander
magnus@hagander.net
In reply to: Fujii Masao (#2)
Re: [COMMITTERS] pgsql: Adjust total size in pg_basebackup progress report when reality

On Wed, Aug 17, 2011 at 04:44, Fujii Masao <masao.fujii@gmail.com> wrote:

On Wed, Aug 17, 2011 at 12:00 AM, Magnus Hagander <magnus@hagander.net> wrote:

Adjust total size in pg_basebackup progress report when reality changes

When streaming including WAL, the size estimate will always be incorrect,
since we don't know how much WAL is included. To make sure the output doesn't
look completely unreasonable, this patch increases the total size whenever we
go past the estimate, to make sure we never go above 100%.

http://developer.postgresql.org/pgdocs/postgres/app-pgbasebackup.html
----------------
Enables progress reporting. Turning this on will deliver an approximate progress
report during the backup. Since the database may change during the backup,
this is only an approximation and may not end at exactly 100%. In particular,
when WAL log is included in the backup, the total amount of data cannot be
estimated in advance, and in this case the progress report will only count
towards the total amount of data without WAL.
----------------

ISTM that the last sentence needs to be changed slightly because this commit
changed the total amount so that it contains the amount of WAL.

Indeed it does. Thanks, fixed!

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