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-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 E5A991FC0C for ; Thu, 11 Mar 2021 10:45:38 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 7/7] v2writable: fix undocumented --xapian-only Date: Thu, 11 Mar 2021 02:45:38 -0800 Message-Id: <20210311104538.7743-8-e@80x24.org> In-Reply-To: <20210311104538.7743-1-e@80x24.org> References: <20210311104538.7743-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We can't pass $self and GLOBs across IPC channels transparently. I only noticed this because I'm testing the application/octet-stream fallback with https://public-inbox.org/meta/20210311014539.19756-1-e@80x24.org/ Fixes: bf8df8160076d7a1 ("searchidxshard: use PublicInbox::IPC to kill lots of code") --- lib/PublicInbox/V2Writable.pm | 2 +- t/v2reindex.t | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index cbd4f003..03590850 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -1216,7 +1216,7 @@ sub sync_ranges ($$) { sub index_xap_only { # git->cat_async callback my ($bref, $oid, $type, $size, $smsg) = @_; - my $self = $smsg->{self}; + my $self = delete $smsg->{self}; my $idx = idx_shard($self, $smsg->{num}); $idx->index_eml(PublicInbox::Eml->new($bref), $smsg); $self->{transact_bytes} += $smsg->{bytes}; diff --git a/t/v2reindex.t b/t/v2reindex.t index 05ea952f..56540c8b 100644 --- a/t/v2reindex.t +++ b/t/v2reindex.t @@ -543,4 +543,9 @@ EOF $check_rethread->('3-headed-monster once'); $check_rethread->('3-headed-monster twice'); +my $rdr = { 2 => \(my $err = '') }; +ok(run_script([qw(-index --reindex --xapian-only), $inboxdir], undef, $rdr), + '--xapian-only works'); +is($err, '', 'no errors from --xapian-only'); + done_testing();