Re: server auto-restarts and ipcs - Mailing list pgsql-general

From Tom Lane
Subject Re: server auto-restarts and ipcs
Date
Msg-id 14346.1099971715@sss.pgh.pa.us
Whole thread Raw
In response to Re: server auto-restarts and ipcs  ("Ed L." <pgsql@bluepolka.net>)
Responses Re: server auto-restarts and ipcs
Re: server auto-restarts and ipcs
List pgsql-general
"Ed L." <pgsql@bluepolka.net> writes:
> A power failure led to failed postmaster restart using 7.4.6 (see
> output below).  The short-term fix is usually to delete the pid file
> and restart.

Thinking some more about this ... does anyone know the algorithm used
in Linux to assign shared memory segment IDs?

Your report shows about a dozen shmem segments in use; which would put
the probability of an accidental collision at pretty-tiny.  But if the
kernel's assignment algorithm is nonrandom then it'd be plausible for
the Postgres shmem ID from the previous system boot cycle to match
one of the shmem IDs already handed out in the current boot cycle.
In that case we'd get EACCES from shmctl() which we take to be a trouble
indication.  (This is probably over-conservatism, but I don't want to
relax it without knowing for sure that we need to.)

BTW, do you know what all those shmem segments are for?  My Linux box
shows only one segment in use besides the ones Postgres is using.

            regards, tom lane

pgsql-general by date:

Previous
From: "Florian G. Pflug"
Date:
Subject: Per-Table Transaction Isolation Level?
Next
From: Alvaro Herrera
Date:
Subject: Re: Per-Table Transaction Isolation Level?