Hi, On 2021-03-10 20:26:56 -0800, Andres Freund wrote: > > +static void > > +attach_shared_stats(void) > > +{ > > + MemoryContext oldcontext; > > > + /* > > + * The first attacher backend may still reading the stats file, or the > > + * last detacher may writing it. Wait for the work to finish. > > + */ > > I still believe this kind of approach is too complicated, and we should > simply not do any of this "first attacher" business. Instead read it in > the startup process or such.
I started changing the patch to address my complaints. I'll try to do it as an incremental patch ontop of your 0004, but it might become too unwieldy. Not planning to touch other patches for now (and would be happy if the first few were committed). I do think we'll have to split 0004 a bit - it's just too large to commit as is, I think. Greetings, Andres Freund