RE: Changing shared_buffers without restart
Jack Ng <jack.ng@huawei.com>
From: Jack Ng <Jack.Ng@huawei.com>
To: Andres Freund <andres@anarazel.de>, Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Thom Brown <thom@linux.com>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, Tomas Vondra <tomas@vondra.me>, Thomas Munro <thomas.munro@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>, Ni Ku <jakkuniku@gmail.com>
Date: 2025-07-14T15:18:10Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Remove PG_MMAP_FLAGS from mem.h
- c100340729b6 19 (unreleased) landed
-
Improve runtime and output of tests for replication slots checkpointing.
- 4464fddf7b50 18.0 cited
-
Revert support for improved tracking of nested queries
- f85f6ab051b7 18.0 cited
-
Use exported symbols list on macOS for loadable modules as well
- 3feff3916ee1 18.0 cited
-
Add support for basic NUMA awareness
- 65c298f61fc7 18.0 cited
-
Avoid unnecessary copying of a string in pg_restore.c
- 5e1915439085 18.0 cited
-
aio: Infrastructure for io_method=worker
- 55b454d0e140 18.0 cited
-
Improve InitShmemAccess() prototype
- 2a7b2d97171d 18.0 landed
Just brain-storming here... would moving NBuffers to shared memory solve this specific issue? Though I'm pretty sure that would open up a new set of synchronization issues elsewhere, so I'm not sure if there's a net gain. Jack >-----Original Message----- >From: Andres Freund <andres@anarazel.de> >Sent: Monday, July 14, 2025 11:12 AM >To: Dmitry Dolgov <9erthalion6@gmail.com> >Cc: Thom Brown <thom@linux.com>; Ashutosh Bapat ><ashutosh.bapat.oss@gmail.com>; Tomas Vondra <tomas@vondra.me>; >Thomas Munro <thomas.munro@gmail.com>; PostgreSQL-development <pgsql- >hackers@postgresql.org>; Jack Ng <Jack.Ng@huawei.com>; Ni Ku ><jakkuniku@gmail.com> >Subject: Re: Changing shared_buffers without restart > >Hi, > >On July 14, 2025 10:39:33 AM EDT, Dmitry Dolgov <9erthalion6@gmail.com> >wrote: >>> On Mon, Jul 14, 2025 at 10:23:23AM -0400, Andres Freund wrote: >>> > Those steps are separated in time, and I'm currently trying to >>> > understand what are the consequences of performing them in >>> > different order and whether there are possible concurrency issues >>> > under various scenarios. Does this make more sense, or still not? >>> >>> I still don't understand why it'd ever make sense to put a buffer >>> onto the freelist before updating NBuffers first. >> >>Depending on how NBuffers is updated, different backends may have >>different value of NBuffers for a short time frame. In that case a >>scenario I'm trying to address is when one backend with the new >>NBuffers value allocates a new buffer and puts it into the buffer >>lookup table, where it could become reachable by another backend, which >>still has the old NBuffer value. Correct me if I'm wrong, but >>initializing buffer headers + updating NBuffers means clock sweep can >>now return one of those new buffers, opening the scenario above, right? > >The same is true if you put buffers into the freelist. > >Andres >-- >Sent from my Android device with K-9 Mail. Please excuse my brevity.