pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrei Lepikhov <a.lepikhov@postgrespro.ru>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: introduce dynamic shared memory registry
Date: Thu, 21 Dec 2023 08:50:43 +0200
Message-ID: <8d5b2883-8f55-413c-9548-097748709fc4@postgrespro.ru> (raw)
In-Reply-To: <20231220153342.GA833819@nathanxps13>
References: <20231205034647.GA2705267@nathanxps13>
	<d725b5a7-5507-4630-9482-46f28c3bf0d1@postgrespro.ru>
	<3dcea2e9-c46d-4e4f-8371-9526d1aebc83@postgrespro.ru>
	<CA+Tgmobkqm0EfDw4jjn+Hbc=-5uh6nv8QTxHBj9bMpcQsfXV0g@mail.gmail.com>
	<20231219161444.GD831499@nathanxps13>
	<ZYIvcH8R83hEOKKe@paquier.xyz>
	<80cbdd55-8a9d-4472-b360-893309e1f6ef@postgrespro.ru>
	<20231220153342.GA833819@nathanxps13>

On 20/12/2023 17:33, Nathan Bossart wrote:
> On Wed, Dec 20, 2023 at 11:02:58AM +0200, Andrei Lepikhov wrote:
>> In that case, maybe change the test case to make it closer to real-life
>> usage - with locks and concurrent access (See attachment)?
> 
> I'm not following why we should make this test case more complicated.  It
> is only intended to test the DSM registry machinery, and setting/retrieving
> an atomic variable seems like a realistic use-case to me.

I could provide you at least two reasons here:
1. A More complicated example would be a tutorial on using the feature 
correctly. It will reduce the number of questions in mailing lists.
2. Looking into existing extensions, I see that the most common case of 
using a shared memory segment is maintaining some hash table or state 
structure that needs at least one lock.

Try to rewrite the pg_prewarm according to this new feature, and you 
will realize how difficult it is.

-- 
regards,
Andrei Lepikhov
Postgres Professional






view thread (51+ messages)  latest in thread

Message-ID: <8d5b2883-8f55-413c-9548-097748709fc4@postgrespro.ru>
Permalink:  ../8d5b2883-8f55-413c-9548-097748709fc4@postgrespro.ru/
Also on:    postgresql.org/message-id/8d5b2883-8f55-413c-9548-097748709fc4@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: a.lepikhov@postgrespro.ru, nathandbossart@gmail.com, michael@paquier.xyz, robertmhaas@gmail.com
  Subject: Re: introduce dynamic shared memory registry
  In-Reply-To: <8d5b2883-8f55-413c-9548-097748709fc4@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox