I've become lost in this thread. It started with the unit test in the reopen patch, suddenly jumped to NFS and lockless commits, then sync() got pulled in as well.
The retry logic (part of lockless commits) already handles this case of a segments file being partially written & falling back to the previous one. Robert what problem are you trying to solve here? Mike "robert engels" <[EMAIL PROTECTED]> wrote: > True. It seems that the Lucene code might be a bit more resilient > here though, using the following: > > 1. open the segments file exclusively (if this fails, updates are > prohibited, and an exception is thrown) > 2. write new segments > 3. write segments.new including segments hash & sync > 4. update segments file including hash > 5. delete segments that you can > > Then if it crashes in step 4, it is easy to know segments is bad (out > of date) and use segments.new > If it crashes in steps 3, then segments.new is easily detected as > being corrupt (hash does not match), so you know segments is valid. > > if there are segments that cannot be deleted in 5, every open can > check if it can delete them... > > A similar technique can be used if using lockless commits, just need > to make it segments.XXX.new, etc. > > On Nov 12, 2007, at 7:21 PM, Yonik Seeley wrote: > > > On Nov 12, 2007 7:19 PM, robert engels <[EMAIL PROTECTED]> wrote: > >> I would still argue that it is an incorrect setup - almost as bad as > >> "not plugging the computer in". > > > > A user themselves could even go in and look at the index files (I've > > done so myself)... as could a backup program or whatever. It's a fact > > of life on windows that a move or delete can fail. > > > > -Yonik > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]