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.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 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 2DFC71FB06 for ; Sat, 2 Oct 2021 11:18:36 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 4/4] extsearchidx: emit diagnostics for missing blobs Date: Sat, 2 Oct 2021 11:18:35 +0000 Message-Id: <20211002111835.19220-5-e@80x24.org> In-Reply-To: <20211002111835.19220-1-e@80x24.org> References: <20211002111835.19220-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: I'm not sure why they weren't emitted, earlier. --- lib/PublicInbox/ExtSearchIdx.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm index 972049e420e2..eb7c3d67e072 100644 --- a/lib/PublicInbox/ExtSearchIdx.pm +++ b/lib/PublicInbox/ExtSearchIdx.pm @@ -223,13 +223,16 @@ sub _blob_missing ($$) { # called when $smsg->{blob} is bad my $xref3 = $self->{oidx}->get_xref3($smsg->{num}); my @keep = grep(!/:$smsg->{blob}\z/, @$xref3); if (@keep) { + warn "E: $smsg->{blob} gone, removing #$smsg->{num}\n"; $keep[0] =~ /:([a-f0-9]{40,}+)\z/ or die "BUG: xref $keep[0] has no OID"; my $oidhex = $1; $self->{oidx}->remove_xref3($smsg->{num}, $smsg->{blob}); - my $upd = $self->{oidx}->update_blob($smsg, $oidhex); - my $saved = $self->{oidx}->get_art($smsg->{num}); + $self->{oidx}->update_blob($smsg, $oidhex) or warn <{num} gone ($smsg->{blob} => $oidhex) +EOM } else { + warn "E: $smsg->{blob} gone, removing #$smsg->{num}\n"; $self->{oidx}->delete_by_num($smsg->{num}); } }