Re: Drop replslot after pgstat_shutdown cause assert coredump - Mailing list pgsql-hackers

From Kyotaro Horiguchi
Subject Re: Drop replslot after pgstat_shutdown cause assert coredump
Date
Msg-id 20211022.094543.325857524282670720.horikyota.ntt@gmail.com
Whole thread Raw
In response to Re: Drop replslot after pgstat_shutdown cause assert coredump  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Responses Re: Drop replslot after pgstat_shutdown cause assert coredump
List pgsql-hackers
At Fri, 22 Oct 2021 02:10:21 +0900, Fujii Masao <masao.fujii@oss.nttdata.com> wrote in 
> Even in prior to the commit, pgstat_shutdown_hook() can be called
> before ProcKill() at the backend exit, so ISTM that the problem can
> be reproduced.
> 
> Probably we need to make sure that pgstat_shutdown_hook() is called
> after ProcKill(), e.g., by registering pgstat_shutdown_hook() into

Considering the coming shared-memory based stats collector, pgstat
must be shutdown before shared memory shutdown.  Every operation that
requires stats collector also must be shut down before the pgstat
shutdown. A naive solution would be having before-pgstat-shutdown hook
but I'm not sure it's the right direction.

> on_proc_exit_list (I'm not sure if this change is safe, though).
> Or maybe pgstat logic for replication slot drop needs to be
> overhauled.

I think we don't want to lose the stats numbers of the to-be-dropped
slot. So the slot-drop must happen before pgstat shutdown.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



pgsql-hackers by date:

Previous
From: Masahiro Ikeda
Date:
Subject: Re: LogicalChanges* and LogicalSubxact* wait events are never reported
Next
From: Andres Freund
Date:
Subject: Re: Experimenting with hash tables inside pg_dump