Re: PostgreSQL walsender process doesn't exist after "pg_ctl stop -m fast"

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: y39chen <yan-jack(dot)chen(at)nokia(dot)com>, PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: PostgreSQL walsender process doesn't exist after "pg_ctl stop -m fast"
Date: 2017-11-14 02:04:34
Message-ID: CAB7nPqRfc_GH1Y-YRNj918bDQy_PO5L2F9+a8OWZTc2HYb1ERA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Nov 14, 2017 at 12:05 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> y39chen <yan-jack(dot)chen(at)nokia(dot)com> writes:
>> We encounter one problem that PostgreSQL walsender process doesn't exist
>> after "pg_ctl stop -m fast".
>> Uses PostgreSQL 9.6.2
>
> There was a fix in 9.6.4 that's at least related to this problem.
> It would be interesting to see if you can still reproduce it on
> current 9.6.

Commit that may matter here:
commit: e9d4aa594f2caa8c28d55c41c9926420b1efdb79
author: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
date: Fri, 30 Jun 2017 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
--
Michael

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message y39chen 2017-11-14 02:28:17 Re: PostgreSQL walsender process doesn't exist after "pg_ctl stop -m fast"
Previous Message Michael Paquier 2017-11-14 02:01:36 Re: archive_command not being executed