[Xapian-discuss] Atomic DB rebuilds
Richard Boulton
richard at tartarus.org
Tue Oct 5 13:44:48 BST 2004
On Tue, 2004-10-05 at 13:05 +0100, Olly Betts wrote:
> > Does omega chdir to the database dir before opening all the files? Or is
> > there a race condition as the symlink changes if a DB is being opened?
>
> You're right, there's a race there currently. But you're also right in
> suggesting that it's easily solved by chdir() to the database directory.
> That will also simplify path handling actually.
I have some doubts that chdir() will successfully solve the problem.
What if multiple databases are being used? Presumably you would chdir to
each database directory in turn and open the database. In order to gain
any benefit from having done the chdir, you'll have to use relative
paths when opening the databases.
However, various bits of quartz seem to store the path to the database,
and use that later to access the database directory. If the path is not
absolute, and the cwd has changed, this will break.
For example, QuartzDatabase() stores the path in the "db_dir" member,
and uses this to unlock the database in its destructor. Also, the Btree
class stores the path in its "name" member, and uses this all over the
place (for example, to open the "base[A-B]" files).
Am I missing something obvious?
--
Richard Boulton <richard at tartarus.org>
More information about the Xapian-discuss
mailing list