From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS37560 197.231.220.0/22 X-Spam-Status: No, score=-3.2 required=3.0 tests=AWL,BAYES_00,RCVD_IN_XBL, SPF_FAIL,SPF_HELO_FAIL shortcircuit=no autolearn=no autolearn_force=no version=3.4.0 Received: from 80x24.org (exit1.ipredator.se [197.231.221.211]) by dcvr.yhbt.net (Postfix) with ESMTP id 420D21F404 for ; Fri, 30 Mar 2018 20:55:14 +0000 (UTC) From: "Eric Wong (Contractor, The Linux Foundation)" To: meta@public-inbox.org Subject: [PATCH] searchidx: correct warning for over-vivification Date: Fri, 30 Mar 2018 20:55:13 +0000 Message-Id: <20180330205513.19317-1-e@80x24.org> List-Id: We will vivify multiple ghosts if a message has multiple Message-IDs. --- lib/PublicInbox/SearchIdx.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index a234c8c..c75a4ce 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -544,9 +544,9 @@ sub link_and_save { $doc->add_boolean_term('XPATH' . $xpath) if defined $xpath; $doc->add_boolean_term('Q' . $_) foreach @$mids; - my $vivified = 0; $self->{skel} and die "Should not have read-only skel here\n";; foreach my $mid (@$mids) { + my $vivified = 0; $self->each_smsg_by_mid($mid, sub { my ($cur) = @_; my $type = $cur->type; @@ -568,10 +568,8 @@ sub link_and_save { ++$vivified; 1; }); - } - if ($vivified > 1) { - my $id = '<'.join('> <', @$mids).'>'; - warn "BUG: vivified multiple ($vivified) ghosts for $id\n"; + $vivified > 1 and warn + "BUG: vivified multiple ($vivified) ghosts for $mid\n"; } # not really important, but we return any vivified ghost docid, here: return $doc_id if defined $doc_id; -- EW