Re: A WalSnd issue related to state WALSNDSTATE_STOPPING

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Paul Guo <pguo(at)pivotal(dot)io>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: A WalSnd issue related to state WALSNDSTATE_STOPPING
Date: 2018-11-21 07:09:41
Views: Raw Message | Whole Thread | Download mbox
Lists: pgsql-hackers

On Wed, Nov 21, 2018 at 12:54:30PM +0800, Paul Guo wrote:
> The panic reason is that since there is just one wal sender and
> WalSndCtl->walsnds[0].state is WALSNDSTATE_STOPPING so syncWalSnd will be
> NULL and that causes assert failure. Latest postgresql code removes the
> Assert code but the related similar code logic was kept. It looks like that
> we need to modify the logic similar like below (PG 9.4 STABLE) to allow
> WALSNDSTATE_STOPPING which is reasonable here If I understand correctly.

The checkpointer initializes a shutdown checkpoint where it tells to all
the WAL senders to stop once all the children processes are gone, so it
seems to me that there is little point in processing
SyncRepReleaseWaiters() when a WAL sender is in WALSNDSTATE_STOPPING
state as at this stage syncrep makes little sense. It is still
necessary to process standby messages at this stage so as the primary
can shut down when it is sure that all the standbys have flushed the
shutdown checkpoint record of the primary.

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2018-11-21 07:18:08 Re: incorrect xlog.c coverage report
Previous Message Michael Paquier 2018-11-21 06:00:12 Re: Continue work on changes to recovery.conf API