From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 2E1661F61A for ; Fri, 19 Aug 2022 09:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1660900067; bh=//X4H1ACIpLI4sfqeH9uxDFxrx0abc+Xma73mihdpkQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YSDHxpkdfu6UW6OxWBAE2vLkT9ZMoJsN6wsMuXJvXv3y4OXtSCJhtS7dpnz8xURBM 3s1vOTFgawAqMnZZ8qvlDVFpLUEuhjyrhtZqO6ikSDQ+mZb8N5khD2Es5ycXRBWT2U A9OoWgM8AqV6a+1vIafACvrn5BYnN0oYzlt6tsSE= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 4/4] lei/store: reindex culls over-indexed messages Date: Fri, 19 Aug 2022 09:07:45 +0000 Message-Id: <20220819090745.4094018-5-e@80x24.org> In-Reply-To: <20220819090745.4094018-1-e@80x24.org> References: <20220819090745.4094018-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: I may be the only lei user who has redundantly-indexed messages needing this, though... --- lib/PublicInbox/LeiStore.pm | 9 +++++++++ 1 file changed, 9 insertions(+) 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"); }