pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_basebackup connection closed unexpectedly...
3+ messages / 2 participants
[nested] [flat]

* pg_basebackup connection closed unexpectedly...
@ 2020-02-12 09:22 Mladen Marinović <mladen.marinovic@kset.org>
  2020-02-12 15:09 ` Re: pg_basebackup connection closed unexpectedly... Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Mladen Marinović @ 2020-02-12 09:22 UTC (permalink / raw)
  To: pgsql-general

Hi,

Recently I am having some strange problems with pg_basebackup. About once a
week the backup process ends with an error message like this:

2020-02-11 23:25:40,447 INFO pg_basebackup: could not read COPY data:
server closed the connection unexpectedly
2020-02-11 23:25:40,447 INFO    This probably means the server terminated
abnormally
2020-02-11 23:25:40,447 INFO    before or while processing the request.
2020-02-11 23:25:40,447 ERROR Error creating basebackup! RC: 1

On the database side the logs show the same error:
2020-02-11 23:25:40 UTC [25790]: [1-1] user=replicator,db=[unknown] LOG:
 could not send data to client: Connection reset by peer
2020-02-11 23:25:40 UTC [25790]: [2-1] user=replicator,db=[unknown] ERROR:
 base backup could not send data, aborting backup
2020-02-11 23:25:40 UTC [25790]: [3-1] user=replicator,db=[unknown] LOG:
 could not send data to client: Broken pipe
2020-02-11 23:25:40 UTC [25790]: [4-1] user=replicator,db=[unknown] FATAL:
 connection to client lost
2020-02-11 23:25:40 UTC [29824]: [1-1] user=replicator,db=[unknown] LOG:
 unexpected EOF on standby connection

The problem started occurring after a hardware (RAM + SSD) upgrade and an
OS Upgrade to Ubuntu 18.04. Both the server and backup process run in
separate docker containers on the same machine. This happens randomly on
multiple servers with the same configuration and it is probably not
hardware related. Also, this happens evenly on 9.4 and 9.6, and using the
same docker images that worked flawlessly on the previous installation.

I have been investigating the issue for at least a month and found no
problems in any log or metric before or after the event. I suspect that
this is related to some OS/docker parameter that is not well configured.

Would increasing the database log level give me any more info about what
caused the connection to close?

Regards,
Mladen Marinović

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

* Re: pg_basebackup connection closed unexpectedly...
  2020-02-12 09:22 pg_basebackup connection closed unexpectedly... Mladen Marinović <mladen.marinovic@kset.org>
@ 2020-02-12 15:09 ` Tom Lane <tgl@sss.pgh.pa.us>
  2020-02-13 09:41   ` Re: pg_basebackup connection closed unexpectedly... Mladen Marinović <mladen.marinovic@kset.org>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2020-02-12 15:09 UTC (permalink / raw)
  To: Mladen Marinović <mladen.marinovic@kset.org>; +Cc: pgsql-general

=?UTF-8?Q?Mladen_Marinovi=C4=87?= <mladen.marinovic@kset.org> writes:
> Recently I am having some strange problems with pg_basebackup. About once a
> week the backup process ends with an error message like this:
> 2020-02-11 23:25:40 UTC [25790]: [1-1] user=replicator,db=[unknown] LOG:
>  could not send data to client: Connection reset by peer

Hmmm ....

> The problem started occurring after a hardware (RAM + SSD) upgrade and an
> OS Upgrade to Ubuntu 18.04. Both the server and backup process run in
> separate docker containers on the same machine. This happens randomly on
> multiple servers with the same configuration and it is probably not
> hardware related. Also, this happens evenly on 9.4 and 9.6, and using the
> same docker images that worked flawlessly on the previous installation.
> I have been investigating the issue for at least a month and found no
> problems in any log or metric before or after the event. I suspect that
> this is related to some OS/docker parameter that is not well configured.

How long does the backup run before failing?  If the connection were going
between different machines my suspicions would lean toward a network
timeout.  That seems somewhat unlikely in this configuration, but you
never know.

> Would increasing the database log level give me any more info about what
> caused the connection to close?

Nope, not directly.  It might be useful to figure out whether data
transfer continues full throttle right up until the connection drop,
or whether it stops sooner (and then there's some sort of timeout
before the error occurs).

			regards, tom lane





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

* Re: pg_basebackup connection closed unexpectedly...
  2020-02-12 09:22 pg_basebackup connection closed unexpectedly... Mladen Marinović <mladen.marinovic@kset.org>
  2020-02-12 15:09 ` Re: pg_basebackup connection closed unexpectedly... Tom Lane <tgl@sss.pgh.pa.us>
@ 2020-02-13 09:41   ` Mladen Marinović <mladen.marinovic@kset.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Mladen Marinović @ 2020-02-13 09:41 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-general

On Wed, Feb 12, 2020 at 4:09 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> =?UTF-8?Q?Mladen_Marinovi=C4=87?= <mladen.marinovic@kset.org> writes:
> > Recently I am having some strange problems with pg_basebackup. About
> once a
> > week the backup process ends with an error message like this:
> > 2020-02-11 23:25:40 UTC [25790]: [1-1] user=replicator,db=[unknown] LOG:
> >  could not send data to client: Connection reset by peer
>
> Hmmm ....
>
> > The problem started occurring after a hardware (RAM + SSD) upgrade and an
> > OS Upgrade to Ubuntu 18.04. Both the server and backup process run in
> > separate docker containers on the same machine. This happens randomly on
> > multiple servers with the same configuration and it is probably not
> > hardware related. Also, this happens evenly on 9.4 and 9.6, and using the
> > same docker images that worked flawlessly on the previous installation.
> > I have been investigating the issue for at least a month and found no
> > problems in any log or metric before or after the event. I suspect that
> > this is related to some OS/docker parameter that is not well configured.
>
> How long does the backup run before failing?  If the connection were going
> between different machines my suspicions would lean toward a network
> timeout.  That seems somewhat unlikely in this configuration, but you
> never know.
>

The backup started at 23:00, and it copied 363GB by the time the connection
was closed. It usually takes about 2 hours for the entire database (cca.
1.1TB). I was also thinking that the problem could be network related, but
the network is a virtual docker bridge network on a single machine, and the
backup is usually ok. If it failed during other operations (as this is a
production database) or during every backup it would be easier to see what
the problem could be, but this is really annoyingly random.


>
> > Would increasing the database log level give me any more info about what
> > caused the connection to close?
>
> Nope, not directly.  It might be useful to figure out whether data
> transfer continues full throttle right up until the connection drop,
> or whether it stops sooner (and then there's some sort of timeout
> before the error occurs).
>

I can see that pg_basebackup has a verbose switch, but I am not sure it
will report the stuff you mention. On the database, the log levels
currently are:
client_min_messages = notice
log_min_messages = warning
log_min_error_statement = error

I assume that I should change the first two to at least debug1 to see
something.


>                         regards, tom lane
>

Regards,
Mladen Marinović

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


end of thread, other threads:[~2020-02-13 09:41 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-02-12 09:22 pg_basebackup connection closed unexpectedly... Mladen Marinović <mladen.marinovic@kset.org>
2020-02-12 15:09 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-02-13 09:41   ` Mladen Marinović <mladen.marinovic@kset.org>

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