[Xapian-tickets] [Xapian] #486: add_document() followed by failing replace_document() leaves partial changes

Xapian nobody at xapian.org
Sat Jun 5 09:08:00 BST 2010

#486: add_document() followed by failing replace_document() leaves partial
 Reporter:  olly           |       Owner:  olly 
     Type:  defect         |      Status:  new  
 Priority:  normal         |   Milestone:  1.2.1
Component:  Backend-Chert  |     Version:  1.2.0
 Severity:  normal         |    Keywords:       
Blockedby:                 |    Platform:  All  
 Blocking:                 |  

Comment(by olly):

 I don't much like the idea of having to process the terms twice, though I
 guess we only need to do so in the case when the document already has a
 pending update, which should be an unusual case in general.  But in some
 situations, it might be very common (if you get a constant stream of
 document updates and the same document is often updated multiple times
 between commits - I suspect wiki changes tend to cluster like this for

 In the case that triggered this ticket, notmuch wants the docid before it
 really adds the document (I'm not quite sure why) so it was using code
 like the example.  I suggested Carl gets the next docid using
 {{{db.get_lastdocid() + 1}}} and then calls {{{replace_document()}}} to
 add it.

 Always rolling back all pending changes doesn't sound great either.
 Rolling back changes if we are modifying a document which was added or
 modified since the last commit is avoids that, but at the price of less
 consistent behaviour.

Ticket URL: <http://trac.xapian.org/ticket/486#comment:2>
Xapian <http://xapian.org/>

More information about the Xapian-tickets mailing list