Thanks, now I understand what we're talking about. I'll try reproducing here.
In the "working but slow" design it could be working because it's slow :-)
So we certainly need to understand this, thank you for the patch.
Sanne
2009/9/23 Łukasz Moreń <lukasz.moren(a)gmail.com>:
I agree that Infinispan case is not much different from RamDirectory.
The
major difference is that in RD (also FileDirectory) changes are not batched
like in ID. If I do not wrap changes in InfinispanDirectory(simple remove
tx.begin() from obtain() method and tx.commit() from release() in
InfinispanLock), and immediately commit every change made by IW it works
well. Hovewer it makes indexing really slower, because of frequent
replication to other nodes.
Sanne it's good remark that IW commit is kind of flush.
I've attached patch with InfinispanDirectory, failing test is
testDirectoryWithMultipleThreads in InfinispanDirectoryTest class. It fails
randomly. I think problem is Infinispan commit on lockRelease() in
org.apache.lucene.index.IndexWriter (line 1658) is after IW commit() (line
1654).