Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-committers <pgsql-committers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o
Date: 2021-08-11 13:47:07
Message-ID: CAA4eK1LYw4J+BmYza+1VWF3QGo5NaV7goXFJ8g5gfA3WZRo6Xw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Tue, Aug 10, 2021 at 4:37 PM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>
> The apply worker registers SharedFileSetDeleteOnProcExit() when
> creating a file set to serialize the changes. When it raises an error
> due to conflict during applying the change, the callback eventually
> reports the temp file statistics but pgstat already shut down,
> resulting in this assertion failure.
>

I think we can try to fix this by registering to clean up these files
via before_shmem_exit() as done by Andres in commit 675c945394.
Similar to that commit, we can change the function name
SharedFileSetDeleteOnProcExit to SharedFileSetDeleteOnShmExit and
register it via before_shmem_exit() instead of on_proc_exit(). Can you
try that and see if it fixes the issue for you unless you have better
ideas to try out?

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Masahiko Sawada 2021-08-12 02:09:10 Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o
Previous Message Tom Lane 2021-08-10 22:10:53 pgsql: Fix failure of btree_gin indexscans with "char" type and </<= op

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-08-11 13:55:49 Re: Worth using personality(ADDR_NO_RANDOMIZE) for EXEC_BACKEND on linux?
Previous Message Robert Haas 2021-08-11 13:45:45 Re: Worth using personality(ADDR_NO_RANDOMIZE) for EXEC_BACKEND on linux?