[Xapian-discuss] Atomic DB rebuilds

James Aylett james-xapian at tartarus.org
Tue Oct 5 10:03:31 BST 2004


On Mon, Oct 04, 2004 at 06:55:32PM +0100, Olly Betts wrote:

> > What if your backing filestore isn't a Unix semantics file system?
> > Windows supplies full reliable locking, but I can't remember if its
> > equivalent to symlinks is solid for this sort of thing (the things
> > that are used low-level by the POSIX emulation layer - I'm not even
> > sure if they're normally accessible on NTFS anyway).
> 
> I think if you're trying to use symlinks on a system which doesn't
> really have symlinks, you deserve whatever you get.

Fair point. I'd be interested to see if we could come up with a
solution that works for Windows machines, however.
 
> The Windows POSIX layer is essentially only there so Microsoft salesmen
> can tick the "supports POSIX" box when required to in order to get a
> contract.

Indeed :-)
 
> > I've had many problems, incidentally, with ln -sf not actually
> > updating the symlink, as it should do. Which is one reason why I don't
> > trust 'em.
> 
> At least in the GNU implementation, "ln -sf" actually calls unlink
> rather than creating a temporary symlink and renaming it over the top
> (this appears to be what POSIX says should happen).  So "ln -sf"
> certainly isn't atomic.

That wasn't what I meant - I've had ln -sf fail to unlink the previous
symlink. And silently fail. This is one of the reasons why I don't
like using symlinks :-/
 
> We're getting away from the original issue here.  I doubt Sam is
> accessing his databases over NFS, and I'd be stunned if he was accessing
> them over NFS to a Windows server.

I meant more "I've had this problem (amongst others) with symlinks,
which is why I'm wary of them", meaning that if you're right about
rename() (and it would be weird if it didn't work), people should just
use the things, and at some point I'll get over my phobia ...

J

-- 
/--------------------------------------------------------------------------\
  James Aylett                                                  xapian.org
  james at tartarus.org                               uncertaintydivision.org



More information about the Xapian-discuss mailing list