Re: POSIX shared memory support - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: POSIX shared memory support
Date
Msg-id 200703250207.l2P27Iu13311@momjian.us
Whole thread Raw
In response to Re: POSIX shared memory support  (Chris Marcellino <cmarcellino@apple.com>)
List pgsql-patches
Newest version added:

Your patch has been added to the PostgreSQL unapplied patches list at:

    http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

---------------------------------------------------------------------------


Chris Marcellino wrote:
> In case you haven't had enough, here is another version of the code
> to make Postgres use POSIX shared memory. Along with the issues that
> have already been addressed, this version ensures that orphaned
> backends are not in the database when restarting Postgres by using a
> single 1 byte SysV segment to see who is attached to the segment
> using shmctl/IPC_STAT/nattach.
>
> This effectively frees Postgres from the SHMMAX and SHMALL limits.
> Since this still takes one SysV segment, SHMMNI can still be reached
> on most platforms if a ton of databases are opened simultaneously
> (i.e. 32 on Mac OS X, 256 on Linux and Solaris).
>
> If you have the need to ship a product with Postgres embedded in it
> and are unable to change kernel settings (like myself), this might be
> of use to you. I have tested all of the failure situations I could
> think of by various combinations of deleting lockfiles while in use,
> changing the PID inside the lockfile and trying to restart and run
> more than one postmaster simultaneously.
>
> Of course, this since this requires both POSIX and SysV shared
> memory, this doesn't increase the portability of Postgres which might
> make it less appropriate for mass distribution; I thought I would put
> it out there for any feedback either way.
>
> Thanks again,
> Chris Marcellino
>

[ Attachment, skipping... ]

>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster

--
  Bruce Momjian  <bruce@momjian.us>          http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: POSIX Shared memory, revised, again
Next
From: Bruce Momjian
Date:
Subject: Re: Load distributed checkpoint V3