[Xapian-tickets] [Xapian] #284: occasional DatabaseModifiedErrors
Xapian
nobody at xapian.org
Thu Apr 9 19:58:06 BST 2009
#284: occasional DatabaseModifiedErrors
---------------------------+------------------------------------------------
Reporter: mrks | Owner: olly
Type: defect | Status: assigned
Priority: normal | Milestone: 1.1.1
Component: Backend-Flint | Version: SVN trunk
Severity: normal | Resolution:
Keywords: | Blockedby:
Platform: Linux | Blocking:
---------------------------+------------------------------------------------
Comment(by richard):
I believe that our algorithm is at fault. Here's my reasoning:
Suppose we start at revision 7. All readers are open at revision 7.
The writer, as soon as any modifications are made, writes these modified
blocks with a revision number of 8. This is fine, since only blocks which
are not used in revision 7 are modified.
When the commit happens, the writer writes all modified blocks as revision
8.
At this point, any new readers will open revision 8. However, old readers
(even if they called reopen() just before the commit), will still be on
revision 7.
After the commit, any further modifications will be written as revision 9.
If a revision 7 reader sees one of these, it will raise the error we've
seen. However, the writer is now only guaranteeing not to modify blocks
used in revision 8, so this is quite possible.
In other words, the algorithm only guarantees that reopen() will prevent
DatabaseModifiedErrors being raised if the writer holds off writing blocks
to the database for a period of time equal to, at least, the longest
length that readers are reading from the database after calling reopen().
--
Ticket URL: <http://trac.xapian.org/ticket/284#comment:15>
Xapian <http://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list