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