On Thu, May 7, 2009 at 5:03 PM, Jim Murphy <jim.mur...@pobox.com> wrote: > Question 1: I see in DirectUpdateHandler2 that there is a read/Write lock > used between addDoc and commit. > > My mental model of the process was this: clients can add/update documents > until the auto commit threshold was hit. At that point the commit tracker > would schedule a background commit. The commit would run and NOT BLOCK > subsequent adds. clearly thast not happening because when the autocommit > background thread runs it gets the iwCommit lock blocking anyone in addDoc > trying to get iwAccess lock.
Background: in the past, you had to close the Lucene IndexWriter so all changes would be flushed to disk (and you could then open a new IndexReader to seel the changes). You obviously can't be adding new documents while you're trying to close the writer - hence the locking. It as also the case that readers and writers had to be opened and closed in the right way to handle things like deletes (which had to go through the reader). This is no longer the case, and we should revisit the locking. I do think we should be able to continue indexing while doing a commit. -Yonik http://www.lucidimagination.com