You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Lance Norskog <go...@gmail.com> on 2010/11/02 05:57:23 UTC

Default file locking on trunk

Scenario:

Git update to current trunk (Nov 1, 2010).
Build all
Run solr in trunk/solr/example with 'java -jar start.jar'
Hi ^C
Jetty reports doing shutdown hook

There is now a data/index with a write lock file in it. I have not
attempted to read the index, let alone add something to it.
I start solr again, and it cannot open the index because of the write lock.

Why is there a write lock file when I have not tried to index anything?

-- 
Lance Norskog
goksron@gmail.com

Re: Default file locking on trunk

Posted by Lance Norskog <go...@gmail.com>.
Ok, more detail: I was testing using the NoMergePolicy in Solr. As
Hoss pointed out in another thread, NoMergePolicy has no 0-argument
constructor, and so throws an exception during loading the core.

When there is no existing data/index/ directory, Solr creates a new
index/ directory at the beginning of loading the core, locks it, but
does not flush out an empty index. Here's the problem: when the core
fails while being loaded (in this case because the core configuration
was bogus) it left the index/ directory locked. It did not flush out
the new empty index (just the segment* files).

So, if a core has no index, and fails during loading, it should either
write out an empty index as it intended to, or remove the half-built
data/index/ directory. Or just not make the empty index until loading
completes?

Lance

On Wed, Nov 10, 2010 at 11:52 AM, Chris Hostetter
<ho...@fucit.org> wrote:
>
> : There is now a data/index with a write lock file in it. I have not
> : attempted to read the index, let alone add something to it.
> : I start solr again, and it cannot open the index because of the write lock.
>
> Lance, i can't reproduce using trunk r1033664 on Linux w/ext4 -- what OS &
> Filesystem are you using?
>
> If you load "http://localhost:8983/solr/admin/stats.jsp" what does it list
> for the "reader" and "readerDir" in the "searcher" entry?
>
> : Why is there a write lock file when I have not tried to index anything?
>
> No idea ... i don't get any write locks until i actually attempt to index
> something.
>
>
>
> -Hoss
>



-- 
Lance Norskog
goksron@gmail.com

Re: Default file locking on trunk

Posted by Chris Hostetter <ho...@fucit.org>.
: There is now a data/index with a write lock file in it. I have not
: attempted to read the index, let alone add something to it.
: I start solr again, and it cannot open the index because of the write lock.

Lance, i can't reproduce using trunk r1033664 on Linux w/ext4 -- what OS & 
Filesystem are you using?

If you load "http://localhost:8983/solr/admin/stats.jsp" what does it list 
for the "reader" and "readerDir" in the "searcher" entry? 

: Why is there a write lock file when I have not tried to index anything?

No idea ... i don't get any write locks until i actually attempt to index 
something.



-Hoss