> 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.