Re: elog.c query_id support vs shutdown

2021-08-19 Thread Michael Paquier
On Thu, Aug 19, 2021 at 05:20:52AM -0700, Andres Freund wrote: > Done. Thanks. There does not seem to be anything left here, so I have marked this open item as fixed. -- Michael signature.asc Description: PGP signature

Re: elog.c query_id support vs shutdown

2021-08-19 Thread Bruce Momjian
On Thu, Aug 19, 2021 at 05:20:52AM -0700, Andres Freund wrote: > On 2021-08-19 01:10:55 -0700, Andres Freund wrote: > > On 2021-08-19 17:05:01 +0900, Michael Paquier wrote: > > > Okay. Would you like to write a patch then? > > > > I'll push something in a bit... > > Done. Thanks. I was kind of

Re: elog.c query_id support vs shutdown

2021-08-19 Thread Julien Rouhaud
On Thu, Aug 19, 2021 at 8:20 PM Andres Freund wrote: > > On 2021-08-19 01:10:55 -0700, Andres Freund wrote: > > On 2021-08-19 17:05:01 +0900, Michael Paquier wrote: > > > Okay. Would you like to write a patch then? > > > > I'll push something in a bit... > > Done. Thanks!

Re: elog.c query_id support vs shutdown

2021-08-19 Thread Andres Freund
On 2021-08-19 01:10:55 -0700, Andres Freund wrote: > On 2021-08-19 17:05:01 +0900, Michael Paquier wrote: > > Okay. Would you like to write a patch then? > > I'll push something in a bit... Done.

Re: elog.c query_id support vs shutdown

2021-08-19 Thread Andres Freund
On 2021-08-19 17:05:01 +0900, Michael Paquier wrote: > Okay. Would you like to write a patch then? I'll push something in a bit... - Andres

Re: elog.c query_id support vs shutdown

2021-08-19 Thread Michael Paquier
On Thu, Aug 19, 2021 at 03:29:40PM +0800, Julien Rouhaud wrote: > On Thu, Aug 19, 2021 at 3:05 PM Michael Paquier wrote: > > > > The thread of this open item is now idle for 10 days and there does > > not seem to be a lot of progress. Bruce, this is assigned to you. > > Are you planning to look a

Re: elog.c query_id support vs shutdown

2021-08-19 Thread Julien Rouhaud
On Thu, Aug 19, 2021 at 3:05 PM Michael Paquier wrote: > > The thread of this open item is now idle for 10 days and there does > not seem to be a lot of progress. Bruce, this is assigned to you. > Are you planning to look at it? I'm really sorry for the lack of answer on my side, I had too many

Re: elog.c query_id support vs shutdown

2021-08-19 Thread Michael Paquier
On Mon, Aug 09, 2021 at 11:29:24AM +0800, Julien Rouhaud wrote: > Ah indeed! This was quite a long thread so I didn't try to see when > that changed. I also now realize that I made a typo in the patch > where I s/loop/look/ which was then changed to s/look/lock/. The > comment should be somethin

Re: elog.c query_id support vs shutdown

2021-08-08 Thread Julien Rouhaud
On Mon, Aug 9, 2021 at 3:06 AM Andres Freund wrote: > > Hi, > > On 2021-08-08 11:53:39 -0700, Andres Freund wrote: > > On 2021-08-08 13:46:39 +0800, Julien Rouhaud wrote: > > > > I suspect that to make the elog.c usage safe, we'll have to clear > > > > MyBEEntry in > > > > pgstat_beshutdown_hook(

Re: elog.c query_id support vs shutdown

2021-08-08 Thread Andres Freund
Hi, On 2021-08-08 11:53:39 -0700, Andres Freund wrote: > On 2021-08-08 13:46:39 +0800, Julien Rouhaud wrote: > > > I suspect that to make the elog.c usage safe, we'll have to clear > > > MyBEEntry in > > > pgstat_beshutdown_hook(). > > > > I agree, and a quick test indeed fix your scenario. It

Re: elog.c query_id support vs shutdown

2021-08-08 Thread Andres Freund
Hi, On 2021-08-08 13:46:39 +0800, Julien Rouhaud wrote: > On Sat, Aug 07, 2021 at 04:44:07PM -0700, Andres Freund wrote: > > > > As currently implemented those pgstat_get_my_query_id() calls are not > > safe. It's fine during backend startup because MyBEEntry is not set, but > > during shutdown t

Re: elog.c query_id support vs shutdown

2021-08-07 Thread Julien Rouhaud
On Sun, Aug 08, 2021 at 01:46:39PM +0800, Julien Rouhaud wrote: > On Sat, Aug 07, 2021 at 04:44:07PM -0700, Andres Freund wrote: > > > > As currently implemented those pgstat_get_my_query_id() calls are not > > safe. It's fine during backend startup because MyBEEntry is not set, but > > during shu

Re: elog.c query_id support vs shutdown

2021-08-07 Thread Julien Rouhaud
On Sat, Aug 07, 2021 at 04:44:07PM -0700, Andres Freund wrote: > > As currently implemented those pgstat_get_my_query_id() calls are not > safe. It's fine during backend startup because MyBEEntry is not set, but > during shutdown that's not ok, because we never unset MyBEEntry. > > andres@awork3: