]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
extindex: fix --reindex when blobs go missing
authorEric Wong <e@80x24.org>
Tue, 16 Sep 2025 10:25:05 +0000 (10:25 +0000)
committerEric Wong <e@80x24.org>
Wed, 17 Sep 2025 21:37:25 +0000 (21:37 +0000)
Blobs in v2 repos may be purged, ensure we don't try to parse
non-existent blobs for List-IDs to remove from Xapian when they
go missing.  The invalid List-IDs will be removed in a later
stage of the reindex process.

lib/PublicInbox/ExtSearchIdx.pm

index c60b6f43f1c161c365dddd9cc61074363f1b89a1..1e48facaac81b97c0b86dbb1404f8d0c802f0469 100644 (file)
@@ -225,7 +225,7 @@ sub _unref_doc ($$$$$;$) {
        if (scalar(@$xr3) == 0) { # all gone
                remove_doc($self, $docid);
        } else { # enqueue for reindex of remaining messages
-               if ($ibx && $self->{-need_xapian}) {
+               if ($eml && $ibx && $self->{-need_xapian}) {
                        my $ekey = $ibx->{-gc_eidx_key} // $ibx->eidx_key;
                        my $idx = $self->idx_shard($docid);
                        my @list_ids = $eml->header_raw('List-Id');