岳帅杰
2009-Nov-12 10:03 UTC
[Xapian-discuss] Questions about the "Atomic modifications" of xapian
Hi, all: I read the "Xapian Administrator's Guide" and it says in the "Atomic modifications" section: """ If the system is interrupted during a modification, the database should always be left in a valid state. This applies even if the power is cut unexpectedly, as long as the disk does not become corrupted due to hardware failure. """ I want to know how xapian could guarantee this. I cannot found answer on the web. Could anyone can give some explaination? -- Best wishes from Ray ...
Olly Betts
2009-Nov-12 23:06 UTC
[Xapian-discuss] Questions about the "Atomic modifications" of xapian
On Thu, Nov 12, 2009 at 06:03:38PM +0800, ????????? wrote:> """ > If the system is interrupted during a modification, the database should > always be left in a valid state. This applies even if the power is cut > unexpectedly, as long as the disk does not become corrupted due to hardware > failure. > """ > > I want to know how xapian could guarantee this. I cannot found answer on > the web.The B-tree manager supports versioning, so updates are made to a new version of the tree which isn't made "current" until we want to commit it. See http://xapian.org/docs/internals.html for some more information, and the source code in backends/flint (or backends/chert for trunk, though it is pretty similar in this regard) for the gory details. Cheers, Olly