[
https://issues.apache.org/jira/browse/LUCENE-5612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13973960#comment-13973960
]
Uwe Schindler commented on LUCENE-5612:
---------------------------------------
About the problem with the lock file and deleting them. The main issue is that
if a file is called "write.lock", the users think there is something wrong. I
propose:
- SimpleFSLockFactory will use write.lock as usual
- NativeFSLockFactory will use a different lock file name with a better name
(because the file is not there to lock by its existence (like lock files do),
it is there as a "communication point". So I would propose to create this file
one time (after opening IndexWriter) and never ever delete it. The file should
be named like "index.dir", so it does not really look like a lock file, more
like a "marker file". Another idea: could we maybe lock on segments.gen file?
I thought about it: deleting the file in deleteOnExit will bring the same
problems we have currently! So the NativeFSLock file should stay alive for the
lifetime of the index and should be named like a marker file.
The only backside, because the lock files are named different, the 2 different
lock factories can no longer work together. But this never worked correctly, so
it is better to not support this at all (by using different file names).
> LockStressTest fails always with NativeFSLockFactory
> ----------------------------------------------------
>
> Key: LUCENE-5612
> URL: https://issues.apache.org/jira/browse/LUCENE-5612
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Robert Muir
> Priority: Blocker
> Fix For: 4.8
>
> Attachments: LUCENE-5612-instant-crush.patch,
> LUCENE-5612-instant-crush.patch,
> LUCENE-5612-more-sophisticated-crusher.patch,
> LUCENE-5612-more-sophisticated-crusher.patch,
> LUCENE-5612-more-sophisticated-crusher.patch, LUCENE-5612-tester.patch,
> LUCENE-5612-tester.patch, LUCENE-5612.patch
>
>
> I was looking at this, because i wanted to remove the static map inside
> NativeFSLockFactory (no particular reason: it just smells bad, we require
> java7, and you get overlappingexception as of java6 so its unnecessary).
> Before changing any code, i wanted to run lockstresstest first, just to
> ensure it works: but it fails always. Simple works fine always.
> Exception in thread "main" java.lang.RuntimeException:
> java.lang.RuntimeException: lock was double acquired at
> org.apache.lucene.store.VerifyingLockFactory$CheckedLock.verify(VerifyingLockFactory.java:67)
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]