[Yanel-dev] problem re-starting Yanel containing a realm with search lock

Michael Wechner michael.wechner at wyona.com
Mon May 19 14:22:11 CEST 2008


Josias Thöny wrote:

> Michael Wechner wrote:
>
>> Josias Thöny wrote:
>>
>>> Michael Wechner wrote:
>>>
>>>> Hi
>>>>
>>>> I have recently noticed the following problem
>>>>
>>>> 21420 2008-05-19 11:28:24,992 [http-9290-Processor25] ERROR 
>>>> org.wyona.yanel.core.map.RealmManager.readRealms():259  - Error 
>>>> setting up realm [yanel-website]: 
>>>> /home/ulysses/src/realms/yanel-website/realm.xml: 
>>>> java.lang.Exception: Could not configure realm [yanel-website] with 
>>>> config file: /home/ulysses/src/realms/yanel-website/realm.xml: 
>>>> org.wyona.yarep.core.RepositoryException: Could not create 
>>>> repository: yanel-website 
>>>> /home/ulysses/src/realms/yanel-website/config/res-config-repository.xml 
>>>> Could not read repository configuration: Lock obtain timed out: 
>>>> SimpleFSLock@/home/ulysses/src/realms/yanel-website/res-configs-repo/search-index/write.lock 
>>>>
>>>>        at org.wyona.yanel.core.map.Realm.<init>(Realm.java:104)
>>>>        at 
>>>> org.wyona.yanel.core.map.RealmManager.readRealms(RealmManager.java:232) 
>>>>
>>>>        at 
>>>> org.wyona.yanel.core.map.RealmManager.<init>(RealmManager.java:118)
>>>>        at 
>>>> org.wyona.yanel.core.map.RealmManager.<init>(RealmManager.java:76)
>>>>        at org.wyona.yanel.core.Yanel.init(Yanel.java:80)
>>>>        at 
>>>> org.wyona.yanel.servlet.YanelServlet.init(YanelServlet.java:154)
>>>>
>>>>
>>>> I haven't noticed this before. Is it possible that this is some 
>>>> regression of the recent repo changes? That some IndexWriter isn't 
>>>> closed properly?
>>>
>>>
>>>
>>> There was a bug in yanel that it didn't close the res-config 
>>> repository upon shutdown.
>>> I fixed this on 2008-05-13 16:36:47 (r36537).
>>
>>
>>
>> thanks
>>
>>> Then I noticed that other repositories (ac-identities, ac-policies, 
>>> custom repos) are not closed upon shutdown either. I'm not sure how 
>>> to fix this.
>>
>>
>>
>>
>> well, it would be nice to shutdown these as well, but I think the 
>> problem above isn't really solved by shutting down, but rather that 
>> the IndexWriter needs to be closed every time after the writing has 
>> finished, because in the case of cluster with multiple nodes 
>> accessing the same index we will have a real problem.
>>
>> Is there any reason that the IndexWriter isn't closed?
>
>
> The problem is that it's not allowed to open more than one IndexWriter 
> for one search index, see [1]. So if multiple threads (within one 
> cluster node or spread among several nodes) start indexing at the same 
> time, there will be LockObtainFailedExceptions. That's what happened 
> in our customer project.


ok

> That's why I changed the behaviour to have only one IndexWriter which 
> is closed when the repository is shut down.


where exactly did you change this? Within the configure/init and 
shutdown methods of Yarep? Is this Yarep repo implementation specific?

> Now I realize that this doesn't work in a cluster. Doh!


right, but it's very important that this works within a clustered 
environment

> Maybe there should be a special clustered yarep implementation which 
> performs some synchronization. I think it should not be required for 
> all yarep implementations to be clusterable, because it can add a lot 
> of complexity


maybe we can hide the complexity

> and adds a performance penalty.


You mean because initializing an IndexWriter is bad for performance? I 
would argue the cluster improves the peformance in the end/long run, so 
that being able to cluster is more important than having a performance 
gain for a single node.

Well, how can we fix this? At the moment we have the problem, that all 
our clustered solutions do not work anymore and I would like to fix this 
as quick as possible. At the same time you are saying that one receives 
a LockObtainFailedExceptions when multiple threads are trying to write. 
I am sure there is some way that we can fix both problems.

Any idea?

Thanks

Michi

>
> Josias
>
> [1] 
> http://lucene.apache.org/java/2_2_0/api/org/apache/lucene/index/IndexWriter.html 
>
>
>>
>>> Maybe with a finalize() method of the IdentityManager/PolicyManager?
>>>
>>> BTW, why is indexing enabled for the res-config repository of the 
>>> yanel-website realm?
>>
>>
>>
>> no, it would make sense to disable this.
>>
>> Cheers
>>
>> Michi
>>
>>>
>>> josias
>>>
>>>>
>>>> Also maybe 
>>>> http://www.manning-sandbox.com/message.jspa?messageID=39279 helps
>>>>
>>>> Thanks
>>>>
>>>> Michi
>>>>
>>>
>>> _______________________________________________
>>> Yanel-development mailing list
>>> Yanel-development at wyona.com
>>> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development
>>
>>
>>
>>
>
> _______________________________________________
> Yanel-development mailing list
> Yanel-development at wyona.com
> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development



-- 
Michael Wechner
Wyona      -   Open Source Content Management - Yanel, Yulup
http://www.wyona.com
michael.wechner at wyona.com, michi at apache.org
+41 44 272 91 61



More information about the Yanel-development mailing list