From: Eric Wong Date: Fri, 19 Aug 2022 09:07:45 +0000 (+0000) Subject: lei/store: reindex culls over-indexed messages X-Git-Tag: v1.9.0~7 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=f3578e1c8dcef710b6b1c5f74270bf4e39ab5dd8;p=public-inbox.git lei/store: reindex culls over-indexed messages I may be the only lei user who has redundantly-indexed messages needing this, though... --- diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm index 8e710540..57f0e013 100644 --- a/lib/PublicInbox/LeiStore.pm +++ b/lib/PublicInbox/LeiStore.pm @@ -344,6 +344,15 @@ sub _reindex_1 { # git->cat_async callback my $eml = PublicInbox::Eml->new($bref); $smsg->{-merge_vmd} = 1; # preserve existing keywords $eidx->idx_shard($smsg->{num})->index_eml($eml, $smsg); + } elsif ($type eq 'missing') { + # pre-release/buggy lei may've indexed external-only msgs, + # try to correct that, here + warn("E: missing $hex, culling (ancient lei artifact?)\n"); + $smsg->{to} = $smsg->{cc} = $smsg->{from} = ''; + $smsg->{bytes} = 0; + $eidx->{oidx}->update_blob($smsg, ''); + my $eml = PublicInbox::Eml->new("\r\n\r\n"); + $eidx->idx_shard($smsg->{num})->index_eml($eml, $smsg); } else { warn("E: $type $hex\n"); }