From: Eric Wong Date: Wed, 14 Aug 2024 00:16:44 +0000 (+0000) Subject: lei_search: make missing Xapian docs for kw lookups X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1bfce1401656240c3e8365891d02c433580f1d6;p=thirdparty%2Fpublic-inbox.git lei_search: make missing Xapian docs for kw lookups Missing keyword entries should be non-fatal since Xapian data is always less important than what's in git and SQLite. As such, Xapian data has and remains written last, leaving the possibility of documents being missing from Xapian but present in SQLite and git. This improves recovery dealing with badly interrupted or failed imports due to bugs or hardware failures. --- diff --git a/lib/PublicInbox/LeiSearch.pm b/lib/PublicInbox/LeiSearch.pm index 684668c50..4519306d8 100644 --- a/lib/PublicInbox/LeiSearch.pm +++ b/lib/PublicInbox/LeiSearch.pm @@ -145,7 +145,15 @@ sub kw_changed { } if (!defined($cur_kw) && $@) { $docids = join(', num:', @$docids); - croak "E: num:$docids keyword lookup failure: $@"; + # this may happen if a previous import was incomplete since + # we commit changes to Xapian last + if (ref($@) =~ /::DocNotFoundError\b/) { + warn <