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 A7AEB1FA01 for ; Sun, 17 Oct 2021 09:52:50 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/4] extindex: guard against false mismatch unrefs Date: Sat, 16 Oct 2021 22:52:49 -1100 Message-Id: <20211017095250.22252-4-e@80x24.org> In-Reply-To: <20211017095250.22252-1-e@80x24.org> References: <20211017095250.22252-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: I'm not sure if this is a bug or not (or it could be an old bug in the v2 indexing code). --- lib/PublicInbox/ExtSearchIdx.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm index daff656d1ac5..cb5256a2c562 100644 --- a/lib/PublicInbox/ExtSearchIdx.pm +++ b/lib/PublicInbox/ExtSearchIdx.pm @@ -921,6 +921,16 @@ ibx_id = ? AND xnum >= ? AND xnum <= ? my ($xnum, $hex) = unpack('JH*', $k); my $bin = pack('H*', $hex); my $exp = $mismatch{$xnum}; + if (defined $exp) { + my $smsg = $ibx->over->get_art($xnum) // next; + # $xnum may be expired by another process + if ($smsg->{blob} eq $hex) { + warn <<""; +BUG: (non-fatal) $ekey #$xnum $smsg->{blob} still matches (old exp: $exp) + + next; + } # else: continue to unref + } my $m = defined($exp) ? "mismatch (!= $exp)" : 'stale'; warn("# $xnum:$hex (#@$docids): $m\n"); for my $i (@$docids) {