Re: Changing shared_buffers without restart

From: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
To: Tomas Vondra <tomas(at)vondra(dot)me>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Jack Ng <Jack(dot)Ng(at)huawei(dot)com>, Ni Ku <jakkuniku(at)gmail(dot)com>
Subject: Re: Changing shared_buffers without restart
Date: 2025-07-06 13:21:08
Message-ID: fu4svc7ntotjbg3eklx7y7xzq6tkgrkwgpcn73cbuj5vmcwti6@n36kiymdvali
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Sun, Jul 06, 2025 at 03:01:34PM +0200, Dmitry Dolgov wrote:
> * This way any backend between the ProcSignalBarriers will be able
> proceed with whatever it's doing, and there is need to make sure it
> will not access buffers that will soon disappear. A suggestion so far
> was to get all backends agree to not allocate any new buffers in the
> to-be-truncated range, but accessing already existing buffers that
> will soon go away is a problem as well. As far as I can tell there is
> no rock solid method to make sure a backend doesn't have a reference
> to such a buffer somewhere (this was discussed earlier in thre
> thread), meaning that either a backend has to wait or buffers have to
> be checked every time on access.

And sure enough, after I wrote this I've realized there should be no
such references after the buffer eviction and prohibiting new buffer
allocation. I still need to check it though, because not only buffers,
but other shared memory structures (which number depends on NBuffers)
will be truncated. But if they will also be handled by the eviction,
then maybe everything is just fine.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2025-07-06 14:30:04 Re: [PATCH] Extending FK check skipping on replicas to ADD FK and TRUNCATE
Previous Message Dmitry Dolgov 2025-07-06 13:01:34 Re: Changing shared_buffers without restart