Henry C.
2011-Jul-13 12:17 UTC
[Xapian-discuss] Feature request: Determining source index of xapian-compact DatabaseError exception
Greets, When merging lots of subindexes in batches like so: xapian-compact -m idx1 idx2... dstidx Errors such as: xapian-compact: DatabaseError: Error reading block 0: got end of file present a problem since it does not provide the offending path name (of the broken index) for easy identification/removal in automated/batch scenarios (the way DatabaseOpeningError:.... does, eg). The only way to id the offending path is to step through the list and use xapian-check. The same goes for DatabaseCorruptError and possibly others. Since xapian-compact allows you to pass many paths on the command-line it would be very useful to always emit the index path currently being processed in any error thrown, thus allowing for easy identification of problems in data. I've hacked the source a bit in a few areas (by using std::string name from chert_table.h) to emit *something* useful, eg in ChertTable::read_block(): string message = "Error reading block " + str(n) + ": "; message += strerror(errno); + message += " (current_path: " + name + ")"; throw Xapian::DatabaseError(message); } else if (bytes_read == 0) { string message = "Error reading block " + str(n) + ": got end of file"; + message += " (current_path: " + name + ")"; throw Xapian::DatabaseError(message); What's the possibility of something like this being added in the future? Regards Henry
Olly Betts
2011-Jul-14 02:26 UTC
[Xapian-discuss] Feature request: Determining source index of xapian-compact DatabaseError exception
On Wed, Jul 13, 2011 at 02:17:03PM +0200, Henry C. wrote:> What's the possibility of something like this being added in the future?Pretty likely. There's already a ticket open for it: http://trac.xapian.org/ticket/329 Cheers, Olly