Re: walsender bug: stuck during shutdown

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Chloe Dives <Chloe(dot)Dives(at)cantabcapital(dot)com>, Chris Wilson <chris(dot)wilson(at)cantabcapital(dot)com>
Subject: Re: walsender bug: stuck during shutdown
Date: 2020-11-25 18:45:46
Message-ID: 20201125184546.GA8160@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-Nov-25, Fujii Masao wrote:

> But whether MyWalSnd->write is InvalidRecPtr or not, if it's behind sentPtr,
> walsender should keep waiting for the ack to all the sent message to be
> replied, i.e., isn't this expected behavior of normal shutdown? That is,
> if we want to shutdown walsender even when the client side doesn't
> reply message, immediate shutdown should be used or the client side
> should be terminated, instead?

I don't think "waiting forever" can be considered the expected behavior;
this has caused what are nominally production outages several times
already, since we sent a shutdown signal to the server and it never
completed shutting down.

If you want to propose a better patch to address the issue, feel free,
but keeping things as they are seems a bad idea to me.

(Hmm, maybe another idea would be to have WalSndDone cause a keepalive
message to be sent to the client and complete shut down when we get a
reply to that.)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Christensen 2020-11-25 18:45:51 Re: [PATCH] Add `truncate` option to subscription commands
Previous Message Peter Geoghegan 2020-11-25 18:41:15 Re: Deleting older versions in unique indexes to avoid page splits