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. -- Michael
signature.asc
Description: PGP signature