Skip to main content.
home | support | download

Back to List Archive

Re: indexing and index file copy

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Tue Aug 31 2004 - 14:34:57 GMT
On Tue, Aug 31, 2004 at 03:22:46PM +0100, Jonas Wolf wrote:
> I don't know what people "normally" do in this kind of situation on 
> Windows. However, I found a solution which works fine. I use a different 
> index file name during indexing, which is not accessed from the web 
> search. When indexing is finished, I open a lock file in blocked exclusive 
> mode, and copy the files across. This means the open blocks until 
> exclusive access is granted. The search on the web site opens this lock 
> file in unblocked shared mode before every query, such that several users 
> can use the site at the same time, but not at the same as the file is 
> copied. If the file is being copied, the unblocked open returns false, and 
> I give an error page which reloads itself after a few seconds.

Obviously unlikely, but what happens if you have a lot of busy
clients.  That is, if there's a shared lock open (by the client) will
that prevent you from getting the exclusive block?

Or does the exclusive lock somehow wait until clients release their
shared lock but also prevents new shared locks before the exclusive
lock returns?

Either ways sounds like a potential deadlock.

-- 
Bill Moseley
moseley@hank.org

Unsubscribe from or help with the swish-e list: 
   http://swish-e.org/Discussion/

Help with Swish-e:
   http://swish-e.org/current/docs
   swish-e@sunsite.berkeley.edu
Received on Tue Aug 31 07:36:07 2004