Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-24 Thread Magnus Hagander
On Tue, Apr 24, 2007 at 02:25:41AM -0400, Tom Lane wrote: > Marcin Waldowski <[EMAIL PROTECTED]> writes: > > Ok, that's the end of the story :) My workmate has confirmed that during > > night test PostgreSQL worked perfectly :) > > That fix was Obviously Necessary even without testing -- you're b

Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-24 Thread Tom Lane
Marcin Waldowski <[EMAIL PROTECTED]> writes: > I was thinking that this fix will be included in 8.2.4 :) Now I know > that it's too late (8.2.4 is released). Now I trying to find what > conditions causes to realease new version of PostgreSQL (with fixes). > Does any document exist about that? N

Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-24 Thread Marcin Waldowski
Tom Lane wrote: Marcin Waldowski <[EMAIL PROTECTED]> writes: Ok, that's the end of the story :) My workmate has confirmed that during night test PostgreSQL worked perfectly :) That fix was Obviously Necessary even without testing -- you're being too conservative about not applying it,

Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-23 Thread Tom Lane
Marcin Waldowski <[EMAIL PROTECTED]> writes: > Ok, that's the end of the story :) My workmate has confirmed that during > night test PostgreSQL worked perfectly :) That fix was Obviously Necessary even without testing -- you're being too conservative about not applying it, Magnus.

Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-23 Thread Marcin Waldowski
Magnus, I have applied your patch on 8.2.3 source and built it in mingw environment (with default settings). After 3 hours of performance test nothing happened, log is clear :) In previous test error occur always within first hour (most often within first 20 minutes), so I can initialy conf

Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-23 Thread Magnus Hagander
Marcin Waldowski wrote: > >> The following bug has been logged online: >> >> Bug reference: 3242 >> Logged by: Marcin Waldowski >> Email address: [EMAIL PROTECTED] >> PostgreSQL version: 8.2.3 and 8.2.1 >> Operating system: Windows XP SP2 >> Description:FATAL: could no

Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-23 Thread Marcin Waldowski
The following bug has been logged online: Bug reference: 3242 Logged by: Marcin Waldowski Email address: [EMAIL PROTECTED] PostgreSQL version: 8.2.3 and 8.2.1 Operating system: Windows XP SP2 Description:FATAL: could not unlock semaphore: error code 298 Details:

Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-22 Thread Magnus Hagander
Marcin Waldowski wrote: > Magnus Hagander wrote: >> Tom Lane wrote: >> >>> Magnus Hagander <[EMAIL PROTECTED]> writes: >>> No, it's definitly the right primitive. But we're creating it with a max count of 1. >>> That's definitely wrong. There are at least three rea

Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-21 Thread Marcin Waldowski
Magnus Hagander wrote: Tom Lane wrote: Magnus Hagander <[EMAIL PROTECTED]> writes: No, it's definitly the right primitive. But we're creating it with a max count of 1. That's definitely wrong. There are at least three reasons for a PG process's semaphore to be signaled (heavywe

Re: [HACKERS] Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-20 Thread Andrew Dunstan
Magnus Hagander wrote: The effective max count on Unixen is typically in the thousands, and I'd suggest the same on Windows unless there's some efficiency reason to keep it small (in which case, maybe ten would do). AFAIK there's no problem with huge numbers (it takes an int32, and the do

Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-20 Thread Magnus Hagander
Tom Lane wrote: > Magnus Hagander <[EMAIL PROTECTED]> writes: >> Tom Lane wrote: >>> How is it possible for a semaphore to be unlocked "too many times"? >>> It's supposed to be a running counter of the net V's minus P's, and >>> yes it had better be able to count higher than one. Have we chosen >>

Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-20 Thread Tom Lane
Magnus Hagander <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> How is it possible for a semaphore to be unlocked "too many times"? >> It's supposed to be a running counter of the net V's minus P's, and >> yes it had better be able to count higher than one. Have we chosen >> the wrong Windows pri

Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-20 Thread Magnus Hagander
Tom Lane wrote: > Magnus Hagander <[EMAIL PROTECTED]> writes: >> On Fri, Apr 20, 2007 at 09:20:05AM +0200, Marcin Waldowski wrote: I've looked at the code there, and can't find a clear problem. One way it could happen is if the actual PGSemaphoreUnlock() is called once more than need

Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-20 Thread Tom Lane
Magnus Hagander <[EMAIL PROTECTED]> writes: > On Fri, Apr 20, 2007 at 09:20:05AM +0200, Marcin Waldowski wrote: >>> I've looked at the code there, and can't find a clear problem. One way it >>> could happen is if the actual PGSemaphoreUnlock() is called once more than >>> needed. > CC:ing to hack

Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-20 Thread Marcin Waldowski
Marcin Waldowski wrote: Doesn't the postmaster restart all other backends due to the FATAL error? Are you saying that you can no longer make new connections to the server, or is the problem coming from that the aplpication doesn't like that the server kicked out all connections? No, we a

Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-20 Thread Marcin Waldowski
Magnus Hagander wrote: Hmm, PGSemaphoreUnlock() actually ignore this error, only log that it happens. No. It does ereport(FATAL) which terminates the backend. Oh, now I see, sorry :) Indeed on this one connection we receive exception "FATAL: could not unlock semaphore", after that r

Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-20 Thread Magnus Hagander
On Fri, Apr 20, 2007 at 10:09:39AM +0200, Marcin Waldowski wrote: > Magnus Hagander wrote: > >I've looked at the code there, and can't find a clear problem. One way it > >could happen is if the actual PGSemaphoreUnlock() is called once more than > >needed. > > > >CC:ing to hackers for this questio

Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-20 Thread Marcin Waldowski
Magnus Hagander wrote: I've looked at the code there, and can't find a clear problem. One way it could happen is if the actual PGSemaphoreUnlock() is called once more than needed. CC:ing to hackers for this question: Any chance that's happening? If this happens with SysV semaphores, will they

Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-20 Thread Magnus Hagander
On Fri, Apr 20, 2007 at 09:20:05AM +0200, Marcin Waldowski wrote: > Hello. > > I've made some analysis of PostgreSQL code. It looks like void > PGSemaphoreUnlock(PGSemaphore sema) from backend\port\win32_sema.c was > executed one time more than needed. Certainly looks that way. I've looked at

Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-20 Thread Marcin Waldowski
Hello. I've made some analysis of PostgreSQL code. It looks like void PGSemaphoreUnlock(PGSemaphore sema) from backend\port\win32_sema.c was executed one time more than needed. Error code 298 means "Too many posts were made to a semaphore": http://msdn2.microsoft.com/en-us/library/ms681382.as

Re: [BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-19 Thread Marcin Waldowski
We've made some tests on Linux and it seems like it never happen on this platform, but we use 8.1, not 8.2. select version() PostgreSQL 8.1.3 on i686-pc-linux-gnu, compiled by GCC i686-pc-linux-gnu-gcc (GCC) 3.4.5 (Gentoo 3.4.5, ssp-3.4.5-1.0, pie-8.7.9) Regards, Marcin Marcin Waldowski wrot

[BUGS] BUG #3242: FATAL: could not unlock semaphore: error code 298

2007-04-19 Thread Marcin Waldowski
The following bug has been logged online: Bug reference: 3242 Logged by: Marcin Waldowski Email address: [EMAIL PROTECTED] PostgreSQL version: 8.2.3 and 8.2.1 Operating system: Windows XP SP2 Description:FATAL: could not unlock semaphore: error code 298 Details: Hel