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

Xapian nobody at xapian.org
Fri Jun 4 17:32:19 BST 2010


#486: add_document() followed by failing replace_document() leaves partial
changes
---------------------------+------------------------------------------------
 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:                 |  
---------------------------+------------------------------------------------
 If (without a commit) you do:

 {{{
 #!cpp
 Xapian::Document doc;
 doc.add_term("foo");
 Xapian::docid did = db.add_document(doc);
 doc.add_term("abc");
 doc.add_term(string(1000, 'm'));
 doc.add_term("xyz");
 db.replace_document(did, doc);
 }}}

 then {{{replace_document()}}} throws an exception for the long term, but
 adds "abc" first, so the implicit flush from {{{db}}}'s dtor will write a
 document with part of the changes from the updated document to the
 database.

 (Reported by Carl Worth as affecting notmuch, though I gave him a
 workaround).

-- 
Ticket URL: <http://trac.xapian.org/ticket/486>
Xapian <http://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list