Re: two servers on the same port

From: Eric Haszlakiewicz <erh(at)swapsimple(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: two servers on the same port
Date: 2008-10-27 15:50:21
Message-ID: 20081027155021.GA14343@poe.swapsimple.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Oct 19, 2008 at 11:21:09PM -0400, Tom Lane wrote:
> Eric Haszlakiewicz <erh(at)swapsimple(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Webb Sprague 2008-10-27 16:11:12 Website request -- developer docs along with release docs
Previous Message Jeff Davis 2008-10-27 15:47:23 Re: array_agg and array_accum (patch)