]> Sergey Matveev's repositories - public-inbox.git/commitdiff
extsearchidx: emit diagnostics for missing blobs
authorEric Wong <e@80x24.org>
Sat, 2 Oct 2021 11:18:35 +0000 (11:18 +0000)
committerEric Wong <e@80x24.org>
Sat, 2 Oct 2021 20:09:44 +0000 (20:09 +0000)
I'm not sure why they weren't emitted, earlier.

lib/PublicInbox/ExtSearchIdx.pm

index 972049e420e2dc7fef1b6108830ecae0a16fdf43..eb7c3d67e072c5435936a813868d3dcc74b8e06b 100644 (file)
@@ -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 <<EOM;
+E: #$smsg->{num} gone ($smsg->{blob} => $oidhex)
+EOM
        } else {
+               warn "E: $smsg->{blob} gone, removing #$smsg->{num}\n";
                $self->{oidx}->delete_by_num($smsg->{num});
        }
 }