Re: two servers on the same port - Mailing list pgsql-hackers

From Eric Haszlakiewicz
Subject Re: two servers on the same port
Date
Msg-id 20081027155021.GA14343@poe.swapsimple.com
Whole thread Raw
In response to Re: two servers on the same port  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sun, Oct 19, 2008 at 11:21:09PM -0400, Tom Lane wrote:
> Eric Haszlakiewicz <erh@swapsimple.com> writes:
> > On Sun, Oct 19, 2008 at 10:15:22PM -0400, Tom Lane wrote:
> >> What platform is this, anyway?
> > I'm running on NetBSD 4.
> 
> > Well, it seems that something doesn't work right with the "try the next key"
> > code when the userid are the same.  I'm not really sure what I should try
> > here.
> 
> I read the code and the shmget spec a bit more.  It looks to me like the
> issue may be about the ordering of error checks in the kernel.  The
> Single Unix Spec quoth
...snip...
> If you are starting the two servers with different shmem sizing
> parameters then it is possible that the second reason for giving EINVAL
> applies.  Now our code is expecting to get EEXIST if there's a shmem
...snip...
> So the first question for you is did you give the two servers different
> shmem sizing parameters?  If so, does the behavior change if you start
> them in the opposite order?  If the answer to both is "yes" then I think
> you ought to file a bug against NetBSD kernel.  They're returning an
> error code that is uselessly confusing and out of step with other
> implementations.

Yes, and yes.  The error checking order in NetBSD put the EEXIST return
last so the "different size check" was taking precedence.  I fixed that,
and now starting two pg servers, even in different chroot's, behaves as
expected.  Thanks for the suggestion of where to look!

eric


pgsql-hackers by date:

Previous
From: Robert Treat
Date:
Subject: Re: Hot Standby utility and administrator functions
Next
From: "Webb Sprague"
Date:
Subject: Website request -- developer docs along with release docs