<div>Hi,<br><br>After indexwriter&#39;s commit changes are visible by IndexReaders. Lock is released later. If IR tries to read index between that two events, it doesn&#39;t have current data since changes in Infinispan grid are not visible until tx commit.<br>
This can cause an axception.<br> <br></div><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">Why not commit the Infinispan tx at lock release, instead of at indexwriter&#39;s commit?<br>
</blockquote><br><div class="gmail_quote">W dniu 22 września 2009 02:16 użytkownik Łukasz Moreń <span dir="ltr">&lt;<a href="mailto:lukasz.moren@gmail.com">lukasz.moren@gmail.com</a>&gt;</span> napisał:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>Thanks for explanation.<br>Maybe better I will concentrate on the first release and postpone distributed writing.<br><br>There is already LockStrategy that uses Infinispan. With using it I was wrapping changes made by IndexWriter in Infinispan transaction, because of performance reasons -<br>

on lock obtaining transaction was started, on lock release transaction was commited. Hovewer Ispn transaction commit on lock release is not good idea since IndexWriter calls index commit before lock is released(and ispn transaction is committed). <br>

I was thinking to override Workspace class and getIndexWriter(start infinispan tx), commitIndexWriter (commit tx) methods to wrap IndexWrite lifecycle, but this needs few other changes. Some other ideas?<br><br>Cheers,<br>

Lukasz<br><br><div class="gmail_quote">2009/9/21 Sanne Grinovero <span dir="ltr">&lt;<a href="mailto:sanne.grinovero@gmail.com" target="_blank">sanne.grinovero@gmail.com</a>&gt;</span><div><div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Łukasz,<br>
you&#39;ve rightful concerns, because the way the IndexWriter tries to<br>
achieve the lock<br>
that will bring some trouble; As far as I remember we decided in this<br>
first release<br>
to avoid multiple writer nodes because of this reasons<br>
(that&#39;s written in your docs?)<br>
<br>
Actually it shouldn&#39;t be very hard to do, as the LockStrategy is<br>
pluggable (see changes from HSEARCH-345)<br>
and you could implement one delegating to an Infinispan eager lock on some key,<br>
like the default LockStrategy takes a file lock in the index directory.<br>
<br>
Maybe it&#39;s simpler to support this distributed writing instead of<br>
sending the queue to some single<br>
(elected) node? Would be cool, as the Document Analysis effort would<br>
be distributed,<br>
but I have no idea if this would be more or less efficient than a<br>
single node writing; it could<br>
bring some huge data transfers along the wire during segments merging<br>
(basically fetching<br>
the whole index data at each node performing a segment merge); maybe<br>
you&#39;ll need to<br>
play with IndexWriter settings (<br>
<a href="http://docs.jboss.org/hibernate/stable/search/reference/en/html_single/#lucene-indexing-performance" target="_blank">http://docs.jboss.org/hibernate/stable/search/reference/en/html_single/#lucene-indexing-performance</a><br>


)<br>
probably need to find the sweet spot for &quot;merge_factor&quot;.<br>
I just saw now that MergePolicy is now re-implementable, but I hope<br>
that won&#39;t be needed.<br>
<br>
Sanne<br>
<br>
2009/9/21 Łukasz Moreń &lt;<a href="mailto:lukasz.moren@gmail.com" target="_blank">lukasz.moren@gmail.com</a>&gt;:<br>
<div><div></div><div>&gt; Hi,<br>
&gt;<br>
&gt; I&#39;m wondering if it is reasonable to have multiple threads/nodes that<br>
&gt; modifies indexes in Lucene Directory based on Infinispan? Let&#39;s assume that<br>
&gt; two nodes try to update index in this same time. First one creates<br>
&gt; IndexWriter and obtains<br>
&gt; write lock. There is high propability that second node throws<br>
&gt; LockObtainFailedException (as one IndexWriter is allowed on single index)<br>
&gt; and index is not modified. How is that? Should be always only one node that<br>
&gt; makes changes in<br>
&gt; the index?<br>
&gt;<br>
&gt; Cheers,<br>
&gt; Lukasz<br>
&gt;<br>
&gt; W dniu 15 września 2009 01:39 użytkownik Łukasz Moreń<br>
&gt; &lt;<a href="mailto:lukasz.moren@gmail.com" target="_blank">lukasz.moren@gmail.com</a>&gt; napisał:<br>
&gt;&gt;<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; With using JMeter I wanted to check if Infinispan dir does not crash under<br>
&gt;&gt; heavy load in &quot;real&quot; use and check performance in comparison with none/other<br>
&gt;&gt; directories.<br>
&gt;&gt; However appeared problem when multiple IndexWriters tries to modify index<br>
&gt;&gt; (test InfinispanDirectoryTest) - random deadlocks, and Lucene exceptions.<br>
&gt;&gt; IndexWriter tries to access files in index that were removed before. I&#39;m<br>
&gt;&gt; looking into it, but not having good idea.<br>
&gt;&gt;<br>
&gt;&gt; Concerning the last part, I think similar thing is done in<br>
&gt;&gt; InfinispanDirectoryProviderTest. Many threads are making changes and<br>
&gt;&gt; searching (not checking if db is in sync with index).<br>
&gt;&gt; If threads finish their work, with Lucene query I&#39;m checking if index<br>
&gt;&gt; contains as many results as expected. Maybe you meant something else?<br>
&gt;&gt; Would be good to run each node in different VM.<br>
&gt;&gt;<br>
&gt;&gt;&gt; Great ! Looking forward to it. What state are things in at the moment<br>
&gt;&gt;&gt; if I want to play around with it ?<br>
&gt;&gt;<br>
&gt;&gt; Should work with with one master(updates index) and one many slave nodes<br>
&gt;&gt; (sends changes to master). I tried with one master and one slave (both with<br>
&gt;&gt; jms and jgroups backend) and worked ok. Still fails if multiple nodes want<br>
&gt;&gt; to modify index.<br>
&gt;&gt;<br>
&gt;&gt; I&#39;ve attached patch with current version.<br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt; Łukasz<br>
&gt;&gt;<br>
&gt;&gt; 2009/9/13 Michael Neale &lt;<a href="mailto:michael.neale@gmail.com" target="_blank">michael.neale@gmail.com</a>&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Great ! Looking forward to it. What state are things in at the moment<br>
&gt;&gt;&gt; if I want to play around with it ?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Sent from my phone.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On 13/09/2009, at 7:26 PM, Sanne Grinovero &lt;<a href="mailto:sanne.grinovero@gmail.com" target="_blank">sanne.grinovero@gmail.com</a>&gt;<br>
&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; &gt; 2009/9/12 Michael Neale &lt;<a href="mailto:michael.neale@gmail.com" target="_blank">michael.neale@gmail.com</a>&gt;:<br>
&gt;&gt;&gt; &gt;&gt; That does sounds pretty cool. Would be nice if the lucene indexes<br>
&gt;&gt;&gt; &gt;&gt; could scale along with how people will want to use infinispan.<br>
&gt;&gt;&gt; &gt;&gt; Probably worth playing with.<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; Sure, this is the goal of Łukasz&#39;s work; We know compass has<br>
&gt;&gt;&gt; &gt; some good Directories, but we&#39;re building our own as one based<br>
&gt;&gt;&gt; &gt; on Infinispan is not yet available.<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt; &gt;&gt; Sent from my phone.<br>
&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt; &gt;&gt; On 13/09/2009, at 8:37 AM, Jeff Ramsdale &lt;<a href="mailto:jeff.ramsdale@gmail.com" target="_blank">jeff.ramsdale@gmail.com</a>&gt;<br>
&gt;&gt;&gt; &gt;&gt; wrote:<br>
&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt; &gt;&gt;&gt; I&#39;m afraid I haven&#39;t followed the Infinispan-Lucene implementation<br>
&gt;&gt;&gt; &gt;&gt;&gt; closely, but have you looked at the Compass Project?<br>
&gt;&gt;&gt; &gt;&gt;&gt; (<a href="http://www.compass-project.org/overview.html" target="_blank">http://www.compass-project.org/overview.html</a>) It provides a<br>
&gt;&gt;&gt; &gt;&gt;&gt; simplified interface to Lucene (optional) as well as Directory<br>
&gt;&gt;&gt; &gt;&gt;&gt; implementations built on Terracotta, Gigaspaces and Coherence. The<br>
&gt;&gt;&gt; &gt;&gt;&gt; latter, in particular, might be a useful guide for the Infinispan<br>
&gt;&gt;&gt; &gt;&gt;&gt; implementation. I believe it&#39;s mature enough to have solved many of<br>
&gt;&gt;&gt; &gt;&gt;&gt; the most difficult problems of implementing Directory on a<br>
&gt;&gt;&gt; &gt;&gt;&gt; distributed<br>
&gt;&gt;&gt; &gt;&gt;&gt; Map.<br>
&gt;&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt;&gt; &gt;&gt;&gt; If someone has any experience with Compass (particularly it&#39;s<br>
&gt;&gt;&gt; &gt;&gt;&gt; Directory implementations) I&#39;d be interested in hearing about it...<br>
&gt;&gt;&gt; &gt;&gt;&gt; It&#39;s Apache 2.0 licensed, btw.<br>
&gt;&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt;&gt; &gt;&gt;&gt; -jeff<br>
&gt;&gt;&gt; &gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; &gt;&gt;&gt; infinispan-dev mailing list<br>
&gt;&gt;&gt; &gt;&gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
&gt;&gt;&gt; &gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;&gt;&gt; &gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; &gt;&gt; infinispan-dev mailing list<br>
&gt;&gt;&gt; &gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
&gt;&gt;&gt; &gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt;&gt; &gt; infinispan-dev mailing list<br>
&gt;&gt;&gt; &gt; <a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
&gt;&gt;&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; infinispan-dev mailing list<br>
&gt;&gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div></div></div><br>
</blockquote></div><br>