[Xapian-discuss] How to update DB concurrently?

Peter Karman peter at peknet.com
Wed May 17 22:47:21 BST 2006



Olly Betts scribbled on 5/17/06 4:20 PM:
> On Wed, May 17, 2006 at 04:03:58PM -0500, Peter Karman wrote:
>> Olly Betts scribbled on 5/17/06 2:17 PM:
>>
>>> This "spool directory" style of design is both simple and suitably
>>> robust.
>> a good idea. probably need to do some file locking though, lest you feed 
>> a .dump file to scriptindex that your spooler is in the middle of 
>> writing to.
> 
> No need, just build the files in another directory on the same
> filesystem and use the rename() function to move them into the spool
> directory (it needs to be on the same filesystem for rename() to be
> atomic).
> 
> Or even build them in the spool directory itself with ".tmp" on appended
> and skip those in the indexer (but I tend to favour separate directories
> as directories with lots of files are slower, significantly so on so
> filing systems.)


good ideas, Olly. You prove the adage: more than one way to do it. ;)

-- 
Peter Karman  .  http://peknet.com/  .  peter at peknet.com



More information about the Xapian-discuss mailing list