Re: [HACKERS] pg_basebackup --progress output for batch execution - Mailing list pgsql-hackers

From Jeff Janes
Subject Re: [HACKERS] pg_basebackup --progress output for batch execution
Date
Msg-id CAMkU=1z=nSWx4P=p=YOOEe9EPmQeNkUOANFY+3LRYQcsr91W2Q@mail.gmail.com
Whole thread Raw
In response to [HACKERS] pg_basebackup --progress output for batch execution  (Martin Marques <martin.marques@2ndquadrant.com>)
Responses Re: [HACKERS] pg_basebackup --progress output for batch execution  (Arthur Zakirov <a.zakirov@postgrespro.ru>)
Re: [HACKERS] pg_basebackup --progress output for batch execution  (Martín Marqués <martin@2ndquadrant.com>)
List pgsql-hackers
On Fri, Sep 29, 2017 at 4:00 PM, Martin Marques <martin.marques@2ndquadrant.com> wrote:
Hi,

Some time ago I had to work on a system where I was cloning a standby
using pg_basebackup, that didn't have screen or tmux. For that reason I
redirected the output to a file and ran it with nohup.

I normally (always actually ;) ) run pg_basebackup with --progress and
--verbose so I can follow how much has been done. When done on a tty you
get a nice progress bar with the percentage that has been cloned.

The problem came with the execution and redirection of the output, as
the --progress option will write a *very* long line!

Back then I thought of writing a patch (actually someone suggested I do
so) to add a --batch-mode option which would change the behavior
pg_basebackup has when printing the output messages.


While separate lines in the output file is better than one very long line, it still doesn't seem so useful.  If you aren't watching it in real time, then you really need to have a timestamp on each line so that you can interpret the output.  The lines are about one second apart, but I don't know robust that timing is under all conditions.

I think I agree with Arthur that I'd rather have the decision made by inspecting whether output is going to a tty, rather than by adding another command line option.  But maybe that is not detected robustly enough across all platforms and circumstances?

Cheers,

Jeff

pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: [HACKERS] libpq connection strings: control over the ciphersuites?
Next
From: Stephen Frost
Date:
Subject: Re: [HACKERS] Simplify ACL handling for large objects and removal ofsuperuser() checks