pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #15073: Bad error message for when pg_basebackup fails due to incorrect wal_level
2+ messages / 2 participants
[nested] [flat]

* BUG #15073: Bad error message for when pg_basebackup fails due to incorrect wal_level
@ 2018-02-19 02:23  PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2018-02-19 02:23 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: franz@kalibrr.com

The following bug has been logged on the website:

Bug reference:      15073
Logged by:          Franz Beltran
Email address:      franz@kalibrr.com
PostgreSQL version: 9.6.6
Operating system:   Linux
Description:        

Hi,

I was trying to perform a repmgr standby clone but it gets stuck on
pg_basebackup:

$ /usr/bin/repmgr -h <primary_DB_server_IP> -D /var/lib/postgresql/9.6/main
-d repmgr -U repmgr --upstream-node-id=<primary_DB_node_ID> -f
/etc/postgresql/9.6/main/repmgr.conf standby clone -v --log-level DEBUG
NOTICE: using provided configuration file
"/etc/postgresql/9.6/main/repmgr.conf"
NOTICE: destination directory "/var/lib/postgresql/9.6/main" provided
...
...
...
HINT: this may take some time; consider using the -c/--fast-checkpoint
option
INFO: executing:
  pg_basebackup -l "repmgr base backup"  -D /var/lib/postgresql/9.6/main -h
<primary_DB_server_IP> -p <primary_DB_server_port> -U repmgr -X stream 

Upon checking the logs on the upstream server, the following error is
encountered:

user=repmgr,db=[unknown],app=pg_basebackup,client=<standby_IP>LOG:  could
not send data to client: Broken pipe
user=repmgr,db=[unknown],app=pg_basebackup,client=<standby_IP>ERROR:  base
backup could not send data, aborting backup
user=repmgr,db=[unknown],app=pg_basebackup,client=<standby_IP>FATAL: 
connection to client lost

After some tinkering, we found that updating the following line in the
primary's postgresql.conf from:

wal_level = archive

to:

wal_level = hot_standby

resolves the issue. 

It just seems like a bad user experience and a more meaningful error message
would've helped.

Thanks!

--
Franz Beltran




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #15073: Bad error message for when pg_basebackup fails due to incorrect wal_level
@ 2018-02-19 03:15  Michael Paquier <michael@paquier.xyz>
  parent: PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2018-02-19 03:15 UTC (permalink / raw)
  To: franz@kalibrr.com; pgsql-bugs@lists.postgresql.org

On Mon, Feb 19, 2018 at 02:23:10AM +0000, PG Bug reporting form wrote:
> PostgreSQL version: 9.6.6
> [...]
>
> After some tinkering, we found that updating the following line in the
> primary's postgresql.conf from:
> 
> wal_level = archive
> 
> to:
> 
> wal_level = hot_standby
> 
> resolves the issue. 
> 
> It just seems like a bad user experience and a more meaningful error message
> would've helped.

In PostgreSQL 9.6, "archive" and "hot_standby" have the same meaning for
wal_level, and they map to the new value "replica".  Please note that
with older versions of PostgreSQL, it is perfectly possible to take base
backups with wal_level = archive using pg_basebackup.  You just need to
make sure that max_wal_senders has a positive setting value. 
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2018-02-19 03:15 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-02-19 02:23 BUG #15073: Bad error message for when pg_basebackup fails due to incorrect wal_level PG Bug reporting form <noreply@postgresql.org>
2018-02-19 03:15 ` Michael Paquier <michael@paquier.xyz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox