From: Michael Paquier <michael@paquier.xyz>
To: CNG L <congnanluo@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: Is this a bug in auto vacuum worker?
Date: Wed, 9 Jan 2019 13:50:17 +0900
Message-ID: <20190109045017.GI21835@paquier.xyz> (raw)
In-Reply-To: <CAJ3ejTw2_U7CfC6-eHuWgJaBGy=Fc5RCnVFnmiZbW3GBZnt38g@mail.gmail.com>
References: <CAJ3ejTw2_U7CfC6-eHuWgJaBGy=Fc5RCnVFnmiZbW3GBZnt38g@mail.gmail.com>
On Tue, Jan 08, 2019 at 10:47:01AM -0800, CNG L wrote:
> In AutoVacWorkerMain(), the code calls on_shmem_exit(FreeWorkInfo,0) and
> then kill() to send SIGUSR2 to autovacuum launcher process. In
> FreeWorkInfo() it sets AutoVacuumShmem->av_signal[AutoVacRebalance] = true.
> But, is it possible that when autovacuum launcher’s SIGUSR2 handler checks
> av_signal[AutoVacRebalance], FreeWorkInfo() haven’t set this flag yet and
> thus autovacuum launcher will miss the AutoVacRebalance event?
No, I don't think so. There are a couple of instructions between the
moment SIGUSR2 is sent from the worker to the launcher for rebalancing
and the moment where on_shmem_exit() callbacks are called, still the
launcher gets aware of the death of the worker in ProcKill, so the
order of the events is right (double-checked manually as well):
1) Send SIGUSR2 from the worker to the launcher, asking for
rebalancing.
2) shmem callback is called.
3) launcher noticies the death of the worker, sees the signal, and
triggers the rebalancing.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: michael@paquier.xyz, congnanluo@gmail.com
Subject: Re: Is this a bug in auto vacuum worker?
In-Reply-To: <20190109045017.GI21835@paquier.xyz>
References: <CAJ3ejTw2_U7CfC6-eHuWgJaBGy=Fc5RCnVFnmiZbW3GBZnt38g@mail.gmail.com> <20190109045017.GI21835@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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