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: 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.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 0F1F81F513; Wed, 18 Apr 2018 09:13:19 +0000 (UTC) From: "Eric Wong (Contractor, The Linux Foundation)" To: meta@public-inbox.org Cc: "Eric Wong (Contractor, The Linux Foundation)" Subject: [PATCH 02/12] v1: remove articles from overview DB Date: Wed, 18 Apr 2018 09:13:06 +0000 Message-Id: <20180418091316.29114-3-e@80x24.org> In-Reply-To: <20180418091316.29114-1-e@80x24.org> References: <20180418091316.29114-1-e@80x24.org> List-Id: Otherwise articles show up again... --- lib/PublicInbox/SearchIdx.pm | 2 ++ t/search.t | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index f9b40b0..fd76627 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -385,11 +385,13 @@ sub remove_message { my $db = $self->{xdb}; my $called; $mid = mid_clean($mid); + my $over = $self->{over}; eval { batch_do($self, 'Q' . $mid, sub { my ($ids) = @_; $db->delete_document($_) for @$ids; + $over->delete_articles($ids) if $over; $called = 1; }); }; diff --git a/t/search.t b/t/search.t index 516f567..48c2511 100644 --- a/t/search.t +++ b/t/search.t @@ -409,8 +409,15 @@ sub filter_mids { my $txt = $ro->query('"inside another"'); is($txt->[0]->mid, $res->[0]->mid, 'search inside text attachments works'); + + my $mid = $n->[0]->mid; + my ($id, $prev); + my $art = $ro->next_by_mid($mid, \$id, \$prev); + ok($art, 'article exists in OVER DB'); + $rw->unindex_blob($amsg); + $rw->commit_txn_lazy; + is($ro->lookup_article($art->{num}), undef, 'gone from OVER DB'); } -$rw->commit_txn_lazy; done_testing(); -- EW