Re: Fix assertion in autovacuum worker

2023-11-29 Thread Andres Freund
Hi, On 2023-11-29 11:52:01 -0600, Nathan Bossart wrote: > On Tue, Nov 28, 2023 at 06:48:59PM -0800, Andres Freund wrote: > > On 2023-11-28 20:42:47 -0600, Nathan Bossart wrote: > >> Right. Perhaps we could add a LWLockReleaseAll() to > >> pgstat_shutdown_hook() instead of the autovacuum code, but

Re: Fix assertion in autovacuum worker

2023-11-29 Thread Nathan Bossart
On Tue, Nov 28, 2023 at 06:48:59PM -0800, Andres Freund wrote: > On 2023-11-28 20:42:47 -0600, Nathan Bossart wrote: >> Right. Perhaps we could add a LWLockReleaseAll() to >> pgstat_shutdown_hook() instead of the autovacuum code, but I'm afraid that >> is still just a hack. > > Yea, we'd need tha

Re: Fix assertion in autovacuum worker

2023-11-28 Thread Andres Freund
Hi, On 2023-11-28 20:42:47 -0600, Nathan Bossart wrote: > On Tue, Nov 28, 2023 at 04:03:49PM -0800, Andres Freund wrote: > > On 2023-11-28 16:05:16 -0600, Nathan Bossart wrote: > >> From a glance, it looks to me like the problem is that pgstat_shutdown_hook > >> is registered as a before_shmem_exi

Re: Fix assertion in autovacuum worker

2023-11-28 Thread Nathan Bossart
On Tue, Nov 28, 2023 at 04:03:49PM -0800, Andres Freund wrote: > On 2023-11-28 16:05:16 -0600, Nathan Bossart wrote: >> From a glance, it looks to me like the problem is that pgstat_shutdown_hook >> is registered as a before_shmem_exit callback, while ProcKill is registered >> as an on_shmem_exit c

Re: Fix assertion in autovacuum worker

2023-11-28 Thread Andres Freund
Hi, On 2023-11-28 16:05:16 -0600, Nathan Bossart wrote: > On Tue, Nov 28, 2023 at 07:00:16PM +0100, David Geier wrote: > > PostgreSQL hit the following assertion during error cleanup, after being OOM > > in dsa_allocate0(): > > > > void dshash_detach(dshash_table *hash_table) { > > ASSERT_NO_PART

Re: Fix assertion in autovacuum worker

2023-11-28 Thread Nathan Bossart
On Tue, Nov 28, 2023 at 07:00:16PM +0100, David Geier wrote: > PostgreSQL hit the following assertion during error cleanup, after being OOM > in dsa_allocate0(): > > void dshash_detach(dshash_table *hash_table) { > ASSERT_NO_PARTITION_LOCKS_HELD_BY_ME(hash_table); > > called from pgstat_shutdown_

Fix assertion in autovacuum worker

2023-11-28 Thread David Geier
Hi hackers, PostgreSQL hit the following assertion during error cleanup, after being OOM in dsa_allocate0(): void dshash_detach(dshash_table *hash_table) { ASSERT_NO_PARTITION_LOCKS_HELD_BY_ME(hash_table); called from pgstat_shutdown_hook(), called from shmem_exit(), called from proc_exit(