[Xapian-discuss] another DatabaseModifiedError issue

Markus Wörle mrks at mrks.de
Fri May 30 12:35:49 BST 2008


Am 30.05.2008 um 01:42 schrieb Olly Betts:

>> You see the database revision got only increased by 1 with each
>> explicit flush().
>
> Yes, that's reassuring as it rules out implicit calls to flush  
> (assuming
> the "[Wtf::Index]" logging is from your code).

Yes, it's from my code.

>> Which means that the exception got thrown in
>> FlintTable::set_overwritten().
>
> That's really the only place it could be - the other place it could  
> get
> thrown is if we can't open the database at a consistent revision  
> because
> it keeps changing too quickly.  But it's good to have confirmation.
>
> It would be interesting to know which call to set_overwritten()
> was responsible if you don't mind annotating the places which call
> set_overwritten().

I just added some more lines and trapped the caller.

one flush:
set_overwritten: from block_to_cursor() 10194 > 10192
Xapian::DatabaseModifiedError: set_overwritten
terminate called after throwing an instance of  
'Xapian::DatabaseModifiedError'

later on, another flush:
set_overwritten: from block_to_cursor() 10195 > 10193
Xapian::DatabaseModifiedError: set_overwritten
terminate called after throwing an instance of  
'Xapian::DatabaseModifiedError'
(...)
set_overwritten: from block_to_cursor() 10195 > 10193
terminate called after throwing an instance of  
'Xapian::DatabaseModifiedError'

and another one:
set_overwritten: block_to_cursor 10199 > 10197
Xapian::DatabaseModifiedError: set_overwritten
terminate called after throwing an instance of  
'Xapian::DatabaseModifiedError'
(...)
set_overwritten: block_to_cursor 10199 > 10197
Xapian::DatabaseModifiedError: set_overwritten
terminate called after throwing an instance of  
'Xapian::DatabaseModifiedError'

It says that set_overwritten() got called by  
FlintTable::block_to_cursor(). My changes to the relevant lines of  
code were:

if (REVISION(p) > REVISION(C_[j + 1].p)) {
   fprintf(stderr, "set_overwritten: from block_to_cursor() %d > %d 
\n", REVISION(p), REVISION(C_[j + 1].p));
   set_overwritten();
   return;
}

Feel free to ask me for more information if you need some additional  
values or something like that.

Thanks in advance!

Regards,
mrks



More information about the Xapian-discuss mailing list