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?
http://incubator.apache.org/lucy/docs/perl/Lucy/Docs/FileLocking.html
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.
http://incubator.apache.org/lucy/docs/perl/Lucy/Store/Lock.html#clear_stale-
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