add verbosity to pg_basebackup for sync

Started by Jeff Janesover 7 years ago5 messageshackers
Jump to latest
#1Jeff Janes
jeff.janes@gmail.com

On some recent testing, pg_basebackup -Fp was taking an annoying amount of
time to finish once the it was done copying the data. Using -v seemed to
blame this on "waiting for background process to finish streaming", based
on that being the last message on display while the delay was happening.

But it was really waiting for the syncs of the new -D dir to finish. The
attached patch adds a -v notice that it is starting to do the sync, with
the wording taken from initdb's equivalent message.

I think -P should report everything -v does, just with a carriage return
rather than a newline, but that is a larger issue.

Cheers,

Jeff

Attachments:

pg_basebackup_v_sync.patchapplication/octet-stream; name=pg_basebackup_v_sync.patchDownload+3-0
#2Michael Paquier
michael@paquier.xyz
In reply to: Jeff Janes (#1)
Re: add verbosity to pg_basebackup for sync

On Fri, Jul 27, 2018 at 11:58:42AM -0400, Jeff Janes wrote:

But it was really waiting for the syncs of the new -D dir to finish. The
attached patch adds a -v notice that it is starting to do the sync, with
the wording taken from initdb's equivalent message.

This is a good idea. Would we want that back-patched? I am sure that
nobody is going to complain for an extra informational log.
--
Michael

#3Michael Paquier
michael@paquier.xyz
In reply to: Michael Paquier (#2)
Re: add verbosity to pg_basebackup for sync

On Sat, Jul 28, 2018 at 08:10:10AM +0900, Michael Paquier wrote:

This is a good idea. Would we want that back-patched? I am sure that
nobody is going to complain for an extra informational log.

And pushed to HEAD.
--
Michael

#4Jeff Janes
jeff.janes@gmail.com
In reply to: Michael Paquier (#2)
Re: add verbosity to pg_basebackup for sync

On Fri, Jul 27, 2018 at 7:10 PM, Michael Paquier <michael@paquier.xyz>
wrote:

On Fri, Jul 27, 2018 at 11:58:42AM -0400, Jeff Janes wrote:

But it was really waiting for the syncs of the new -D dir to finish. The
attached patch adds a -v notice that it is starting to do the sync, with
the wording taken from initdb's equivalent message.

This is a good idea. Would we want that back-patched? I am sure that
nobody is going to complain for an extra informational log.

Thanks for committing it. It is probably safer not to backpatch, as
someone might have scripts that look at the output of -v so it shouldn't
change between minor releases. I don't think looking at those would be a
good idea, but they may have their reasons.

Cheers,

Jeff

#5Michael Paquier
michael@paquier.xyz
In reply to: Jeff Janes (#4)
Re: add verbosity to pg_basebackup for sync

On Sun, Jul 29, 2018 at 10:45:10AM -0400, Jeff Janes wrote:

Thanks for committing it. It is probably safer not to backpatch, as
someone might have scripts that look at the output of -v so it shouldn't
change between minor releases. I don't think looking at those would be a
good idea, but they may have their reasons.

Yes, I was wondering about this possibility as well. That's unlikely so
but.. Impossible to be sure.
--
Michael