pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
the database system is shutting down - terminating walsender process due to replication timeout
5+ messages / 3 participants
[nested] [flat]

* the database system is shutting down - terminating walsender process due to replication timeout
@ 2017-10-30 17:31  Zarko Aleksic <zarko.aleksic@outlook.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Zarko Aleksic @ 2017-10-30 17:31 UTC (permalink / raw)
  To: pgsql-general

Greetings everyone,


I'm looking for a bit of help understanding a particular behavior we are seeing with our PostgreSQL 9.6. After issuing a service shutdown command with "systemctl stop" on RHEL 7 our PostgreSQL instance started behaving weirdly. For the first time it wouldn't shutdown so easily / quickly.

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

* the database system is shutting down - terminating walsender process due to replication timeout
@ 2017-10-30 17:35  Zarko Aleksic <zarko.aleksic@live.com>
  parent: Zarko Aleksic <zarko.aleksic@outlook.com>
  1 sibling, 1 reply; 5+ messages in thread

From: Zarko Aleksic @ 2017-10-30 17:35 UTC (permalink / raw)
  To: pgsql-general


Greetings everyone,


I'm looking for a bit of help understanding a particular behavior we are seeing with our PostgreSQL 9.6. After issuing a service shutdown command with "systemctl stop" on RHEL 7 our PostgreSQL instance started behaving weirdly. For the first time it wouldn't shutdown so easily / quickly.

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

* the database system is shutting down - terminating walsender process due to replication timeout
@ 2017-10-30 17:36  Zarko Aleksic <zarko.aleksic@outlook.com>
  parent: Zarko Aleksic <zarko.aleksic@outlook.com>
  1 sibling, 0 replies; 5+ messages in thread

From: Zarko Aleksic @ 2017-10-30 17:36 UTC (permalink / raw)
  To: pgsql-general

Greetings everyone,


I'm looking for a bit of help understanding a particular behavior we are seeing with our PostgreSQL 9.6. After issuing a service shutdown command with "systemctl stop" on RHEL 7 our PostgreSQL instance started behaving weirdly. For the first time it wouldn't shutdown so easily / quickly.

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

* Re: the database system is shutting down - terminating walsender process due to replication timeout
@ 2017-11-01 15:25  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Zarko Aleksic <zarko.aleksic@live.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2017-11-01 15:25 UTC (permalink / raw)
  To: Zarko Aleksic <zarko.aleksic@live.com>; +Cc: pgsql-general

Zarko Aleksic <zarko.aleksic@live.com> writes:
> I'm looking for a bit of help understanding a particular behavior we are seeing with our PostgreSQL 9.6. After issuing a service shutdown command with "systemctl stop" on RHEL 7 our PostgreSQL instance started behaving weirdly. For the first time it wouldn't shutdown so easily / quickly.
> From the logs we could see that standby nodes that were trying to connect were rejected due to database being shutdown. After wal_sender_timeout and wal_receiver_timeout (default 60s) were reached the database finally shut down. It seems that walsender process was preventing the shutdown of the master database - until timeout was reached, a behavior we didn't experience before.

9.6.what?

There were several possibly-relevant bug fixes in 9.6.3 and 9.6.4,
notably this one:

Author: Tom Lane <tgl@sss.pgh.pa.us>
Branch: master Release: REL_10_BR [fca85f8ef] 2017-06-30 12:00:15 -0400
Branch: REL9_6_STABLE Release: REL9_6_4 [e9d4aa594] 2017-06-30 12:00:03 -0400
Branch: REL9_5_STABLE Release: REL9_5_8 [446914f6b] 2017-06-30 12:00:03 -0400
Branch: REL9_4_STABLE Release: REL9_4_13 [5aa8db014] 2017-06-30 12:00:03 -0400

    Fix walsender to exit promptly if client requests shutdown.
    
    It's possible for WalSndWaitForWal to be asked to wait for WAL that doesn't
    exist yet.  That's fine, in fact it's the normal situation if we're caught
    up; but when the client requests shutdown we should not keep waiting.
    The previous coding could wait indefinitely if the source server was idle.
    
    In passing, improve the rather weak comments in this area, and slightly
    rearrange some related code for better readability.
    
    Back-patch to 9.4 where this code was introduced.
    
    Discussion: https://postgr.es/m/14154.1498781234@sss.pgh.pa.us

I think that would only apply if the walsender's client had tried to
disconnect at the same time you were doing the master-server shutdown,
but maybe that's what happened.

There is still work going on around the walsender timeout, so maybe
what you hit is an as-yet-unresolved bug, but in any case you should
be keeping up with minor releases.

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



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

* Re: the database system is shutting down - terminating walsender process due to replication timeout
@ 2017-11-06 22:52  Zarko Aleksic <zarko.aleksic@outlook.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Zarko Aleksic @ 2017-11-06 22:52 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-general

Thanks for you reply. In the meantime we figured out what the issue was. We had a virtual IP that was being released from the master server just as the master would try to stream the last checkpoint. This caused wal_sender process to hang until the timeout value was reached. Technically speaking, it was a networking problem, but not on the switch/router, rather on the host it self. Stopping the replication from standby to the (movable) master VIP was the solution that we went with.


Best regards,
Zarko

________________________________
From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Wednesday, November 1, 2017 10:25 AM
To: Zarko Aleksic
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] the database system is shutting down - terminating walsender process due to replication timeout

Zarko Aleksic <zarko.aleksic@live.com> writes:
> I'm looking for a bit of help understanding a particular behavior we are seeing with our PostgreSQL 9.6. After issuing a service shutdown command with "systemctl stop" on RHEL 7 our PostgreSQL instance started behaving weirdly. For the first time it wouldn't shutdown so easily / quickly.
> From the logs we could see that standby nodes that were trying to connect were rejected due to database being shutdown. After wal_sender_timeout and wal_receiver_timeout (default 60s) were reached the database finally shut down. It seems that walsender process was preventing the shutdown of the master database - until timeout was reached, a behavior we didn't experience before.

9.6.what?

There were several possibly-relevant bug fixes in 9.6.3 and 9.6.4,
notably this one:

Author: Tom Lane <tgl@sss.pgh.pa.us>
Branch: master Release: REL_10_BR [fca85f8ef] 2017-06-30 12:00:15 -0400
Branch: REL9_6_STABLE Release: REL9_6_4 [e9d4aa594] 2017-06-30 12:00:03 -0400
Branch: REL9_5_STABLE Release: REL9_5_8 [446914f6b] 2017-06-30 12:00:03 -0400
Branch: REL9_4_STABLE Release: REL9_4_13 [5aa8db014] 2017-06-30 12:00:03 -0400

    Fix walsender to exit promptly if client requests shutdown.

    It's possible for WalSndWaitForWal to be asked to wait for WAL that doesn't
    exist yet.  That's fine, in fact it's the normal situation if we're caught
    up; but when the client requests shutdown we should not keep waiting.
    The previous coding could wait indefinitely if the source server was idle.

    In passing, improve the rather weak comments in this area, and slightly
    rearrange some related code for better readability.

    Back-patch to 9.4 where this code was introduced.

    Discussion: https://postgr.es/m/14154.1498781234@sss.pgh.pa.us

I think that would only apply if the walsender's client had tried to
disconnect at the same time you were doing the master-server shutdown,
but maybe that's what happened.

There is still work going on around the walsender timeout, so maybe
what you hit is an as-yet-unresolved bug, but in any case you should
be keeping up with minor releases.

                        regards, tom lane

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


end of thread, other threads:[~2017-11-06 22:52 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-10-30 17:31 the database system is shutting down - terminating walsender process due to replication timeout Zarko Aleksic <zarko.aleksic@outlook.com>
2017-10-30 17:35 ` Zarko Aleksic <zarko.aleksic@live.com>
2017-11-01 15:25   ` Tom Lane <tgl@sss.pgh.pa.us>
2017-11-06 22:52     ` Zarko Aleksic <zarko.aleksic@outlook.com>
2017-10-30 17:36 ` Zarko Aleksic <zarko.aleksic@outlook.com>

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