incubator-lucy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marvin Humphrey <>
Subject Re: [lucy-user] Couldn't completely remove 'seg_N'
Date Thu, 17 Nov 2011 07:08:13 GMT
On Thu, Nov 17, 2011 at 08:42:05AM +0200, goran kent wrote:
> Thanks, I've stuck this in, so let's see how it goes.  The docs for
> Lucy::Index::IndexManager don't say much about what exactly the above
> will do.  Presumably it's an extra lock/concurrency check or something
> that will croak if a conflict is detected?

    Both read and write applications accessing an index on a shared volume
    need to identify themselves with a unique host id, e.g. hostname or ip
    address.  Knowing the host id makes it possible to tell which lockfiles
    belong to other machines and therefore must not be removed when the
    lockfile's pid number appears not to correspond to an active process.

    Release all locks that meet the following three conditions: the lock name
    matches, the host id matches, and the process id that the lock was created
    under no longer identifies an active process.

> I see the hostname then goes into write.lock:host, is that merely to
> provide a fingerprint of the last machine to touch the index?  Also, I
> recall vaguely something to the effect that the lockfile will be
> overwritten anyway, does IndexManager prevent that, or maybe I'm
> misunderstanding the context here?

If you don't supply a hostname, machines will zap each other's lockfiles.

Marvin Humphrey

View raw message