Re: [COMMITTERS] pgsql: Code cleanup in the wake of recent LWLock refactoring.

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Code cleanup in the wake of recent LWLock refactoring.
Date: 2016-02-12 18:08:18
Message-ID: CAFj8pRA9rJNBixXpJ9OK=63An1cpCHR6fnVong53oB12sMGoUg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

2016-02-12 17:35 GMT+01:00 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:

>
>
> 2016-02-12 15:46 GMT+01:00 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
>
>>
>>
>> 2016-02-12 15:43 GMT+01:00 Robert Haas <robertmhaas(at)gmail(dot)com>:
>>
>>> On Fri, Feb 12, 2016 at 8:16 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
>>> wrote:
>>> >> That's very strange. It looks to me like you did exactly the right
>>> >> thing. Can you provide any details on how it fails?
>>> >
>>> > Looks like some race conditions is there - but I didn't tested it
>>> deeper
>>>
>>> Well, OK, so I'm totally willing to work with you to help get this
>>> straightened out, but I'm not really going to go download orafce and
>>> debug it for you on company time. I'm fairly sure that won't win me
>>> any large awards.
>>>
>>
>> I'll do it - just need to finish some other. I hope so this night I'll
>> know more.
>>
>
> In _PG_init I am creating new tranche by
> RequestNamedLWLockTranche("orafce", 1);
>
> Immediately when I try to use this lock
>
> shmem_lock = sh_mem->shmem_lock = &(GetNamedLWLockTranche("orafce"))->lock;
>
> I got a error
>
> ERROR: XX000: requested tranche is not registered
> LOCATION: GetNamedLWLockTranche, lwlock.c:602
>
> Because the session initialization doesn't finish, then Orafce doesn't work
>

I am starting to understand - the new design is more strict. The Orafce is
designed to run without registration shared_preload_libraries (it is
possible, but not necessary). But - RequestNamedLWLockTranche is working
only for this use case. Then GetNamedLWLockTranche fails, and all other are
probably consequences because shared memory isn't well initialized. After
setting shared_preload_libraries all tests are running. But I cannot do it
generally.

What is your recommendation for this case? So I have not to use named locks?

Regards

Pavel

>
>
>>
>> Regards
>>
>> Pavel
>>
>>>
>>> --
>>> Robert Haas
>>> EnterpriseDB: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>>
>

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-02-12 18:16:54 Re: Re: [COMMITTERS] pgsql: Add some isolation tests for deadlock detection and resolution.
Previous Message Robert Haas 2016-02-12 17:32:06 Re: pgsql: Add missing "static" qualifier.

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-02-12 18:16:54 Re: Re: [COMMITTERS] pgsql: Add some isolation tests for deadlock detection and resolution.
Previous Message David Steele 2016-02-12 18:05:01 Re: WIP: SCRAM authentication