google-code-export / h2database

Automatically exported from code.google.com/p/h2database
0 stars 1 forks source link

Automatic unlock for Lucene index #141

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Download and unzip attached test_project.zip. Subfolder “db” contains
database with "dirty" Lucene index. 
2. Run "ant".  At this point, you can see
org.apache.lucene.store.LockObtainFailedException exception.
3. Run "ant workaround". You can see "Lucene index unlocked" message.
4. Look at h2.test.FTLWorkaround. This is my ugly workaround.

I think that we need similar automatic unlock procedure with low-level
implementation.

Original issue reported on code.google.com by victor.p...@gmail.com on 17 Nov 2009 at 9:09

Attachments:

GoogleCodeExporter commented 9 years ago
This is a well known Lucene issue. See
https://issues.apache.org/jira/browse/LUCENE-1877

It doesn't make sense to add a workaround code inside H2 for a Lucene issue, if 
the
issue is fixed in (a later version of) Lucene.

I will close the bug. Please add a comment if you don't agree.

Original comment by thomas.t...@gmail.com on 20 Nov 2009 at 10:03

GoogleCodeExporter commented 9 years ago
I am unsure. This issue is closed. I have tried to use last Lucene 2.9.1, but
write.lock file still exist.

OK. This is not problem for _me_ any more.

Original comment by victor.p...@gmail.com on 20 Nov 2009 at 10:59

GoogleCodeExporter commented 9 years ago
I mean that my workaround is working :)

Original comment by victor.p...@gmail.com on 20 Nov 2009 at 11:02

GoogleCodeExporter commented 9 years ago
> I have tried to use last Lucene 2.9.1

Well, the write.lock file that is included in the test case if from an older 
Lucene
version. So can't test with those files.

Lucene 2.9.1 will probably still create such a file (maybe with a different 
name?)
but should now automatically remove it. If not, you need to check with the 
Lucene
guys if they want to re-open the bug (this is unrelated to H2).

Original comment by thomas.t...@gmail.com on 20 Nov 2009 at 11:17

GoogleCodeExporter commented 9 years ago
Test case:
1. Change lib to lucene-core-2.9.1.jar
2. Set breakpoint in FTLCreate and run in under debuger
3. Terminate process

What can you see?

db/test.h2.db
db/test.lock.db  <- no problem on next run
db/test.trace.db
db/test/_0.fdt
db/test/_0.fdx
db/test/segments.gen
db/test/segments_1
db/test/write.lock <- exception on next run

Lucene is not automatically remove write.lock :(

Original comment by victor.p...@gmail.com on 20 Nov 2009 at 11:30

GoogleCodeExporter commented 9 years ago
OK. I will try to investigate the problem in more details.

Original comment by victor.p...@gmail.com on 20 Nov 2009 at 11:35