Re: server auto-restarts and ipcs

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Greg Stark <gsstark(at)MIT(dot)EDU>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: server auto-restarts and ipcs
Date: 2004-11-09 20:52:39
Message-ID: 874qjyiw2w.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


Greg Stark <gsstark(at)MIT(dot)EDU> writes:

> At least in 2.6 it seems to avoid reuse of ids by keeping a global counter
> that is incremented every time a segment is created which ranges from 0..128k
> that it multiplies by 32k and adds to the array index (which is reused
> quickly).
>
> So it doesn't seem plausible that there was an id collision unless this was
> different in 2.4.20. However looking at his list of ids they're all separated
> by multiples of 32769 which is what you would expect from this algorithm at
> least until they start being reused.

Oh I missed the fact that you were talking about after a reboot. So the
algorithm I described would produce exactly the same sequence of ids after any
reboot given the same sequence of creation and deletions. Even if there's a
different sequence as long as the n'th creation is for the m'th array slot it
would get the same id. So collisions would be very common.

(though it seems the sequence is shared across all the ipc objects.)

--
greg

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert Treat 2004-11-09 21:13:41 Re: [GENERAL] FTP mirror problems
Previous Message Ed L. 2004-11-09 20:48:11 Re: troubleshooting deadlocks

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-11-09 21:36:17 Re: server auto-restarts and ipcs
Previous Message Greg Stark 2004-11-09 20:30:39 Re: server auto-restarts and ipcs