On 2/13/07, Ken Krugler <[EMAIL PROTECTED]> wrote:
Hi all,
In looking at the snapinstaller script, it seems to do the following:
1. Copy a new index directory from the master to the slave's Solr
data directory, giving it a name "index.tmp<number>".
2. Delete the current index directory ("index").
3. Rename the temp index directory to be "index".
Then the commit script will send a <commit/> POST to the
.../solr/update service, and the new index gets swapped into use.
I feel like I must be missing something, because it seems like any
request that's in the middle of being processed between step #2 and
the end of a successful swap could fail due to the index changing
underneath. Any insights here?
A Lucene's IndexReader opens all index files it needs when it is instantiated.
Changes to a Lucene index via IndexWriter never change an existing
file... new files are always created.
Put the two together and it allows an IndexWriter (or anything else,
like snapinstaller) to change the index in the background without
impact to open readers.
-Yonik