Re: server auto-restarts and ipcs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Ed L(dot)" <pgsql(at)bluepolka(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: server auto-restarts and ipcs
Date: 2004-11-09 03:41:55
Message-ID: 14346.1099971715@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

"Ed L." <pgsql(at)bluepolka(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2004-11-09 04:05:52 Re: Per-Table Transaction Isolation Level?
Previous Message Florian G. Pflug 2004-11-09 03:34:16 Per-Table Transaction Isolation Level?

Browse pgsql-hackers by date

  From Date Subject
Next Message Ed L. 2004-11-09 04:09:37 Re: server auto-restarts and ipcs
Previous Message John Hansen 2004-11-09 03:26:49 Re: unnest