Re: replication slot stats memory bug - Mailing list pgsql-hackers

From Andres Freund
Subject Re: replication slot stats memory bug
Date
Msg-id 20210318015105.dcfa4ceybdjubf2i@alap3.anarazel.de
Whole thread Raw
In response to Re: replication slot stats memory bug  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

On 2021-03-17 19:36:46 -0400, Tom Lane wrote:
> > But it seems like we just shouldn't allocate it dynamically at all?
> > max_replication_slots doesn't change during postmaster lifetime, so it
> > seems like it should just be allocated once?
> 
> Meh.  I don't see a need to wire in such an assumption here.

It does make it easier for the shared memory stats patch, because if
there's a fixed number + location, the relevant stats reporting doesn't
need to go through a hashtable with the associated locking.  I guess
that may have colored my perception that it's better to just have a
statically sized memory allocation for this.  Noteworthy that SLRU stats
are done in a fixed size allocation as well...

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Permission failures with WAL files in 13~ on Windows
Next
From: Japin Li
Date:
Subject: Re: EXPLAIN/EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW