Re: Changing shared_buffers without restart
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Dmitry Dolgov <9erthalion6@gmail.com>, pgsql-hackers@postgresql.org
Date: 2024-11-27T21:41:45Z
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
Hi, On 2024-11-27 16:05:47 -0500, Robert Haas wrote: > On Wed, Nov 27, 2024 at 3:48 PM Dmitry Dolgov <9erthalion6@gmail.com> wrote: > > My understanding is that clashing of mappings (either at creation time > > or when resizing) could happen only withing the process address space, > > and the assumption is that by the time we prepare the mapping layout all > > the rest of mappings for the process are already done. > > I don't think that's correct at all. First, the user could type LOAD > 'whatever' at any time. But second, even if they don't or you prohibit > them from doing so, the process could allocate memory for any of a > million different things, and that could require mapping a new region > of memory, and the OS could choose to place that just after an > existing mapping, or at least close enough that we can't expand the > object size as much as desired. > > If we had an upper bound on the size of shared_buffers and could > reserve that amount of address space at startup time but only actually > map a portion of it, then we could later remap and expand into the > reserved space. Without that, I think there's absolutely no guarantee > that the amount of address space that we need is available when we > want to extend a mapping. Strictly speaking we don't actually need to map shared buffers to the same location in each process... We do need that for most other uses of shared memory, including the buffer mapping table, but not for the buffer data itself. Whether it's worth the complexity of dealing with differing locations is another matter. Greetings, Andres Freund