From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.1 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 454D71F597; Thu, 19 Jul 2018 03:52:03 +0000 (UTC) Date: Thu, 19 Jul 2018 03:52:03 +0000 From: Eric Wong To: "Eric W. Biederman" Cc: meta@public-inbox.org Subject: Re: [PATCH v2 1/3] Making the search indexes optional Message-ID: <20180719035202.qqertfmrxa4zlvmo@whir> References: <87a7qpjve8.fsf@xmission.com> <20180717233058.30820-3-ebiederm@xmission.com> <20180718102233.jt4loti4k3x3wkp7@whir> <87bmb4ilfc.fsf@xmission.com> <20180718163139.sqgr7im572bnlrgg@dcvr> <87pnzkh4fx.fsf_-_@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87pnzkh4fx.fsf_-_@xmission.com> List-Id: "Eric W. Biederman" wrote: > > This is my respin of these patches. I have used the levels: > full, medium, basic. > > I think basic conveys the message that it is ok to run with and you can > expect most things to work, better than minimal where it feels like > you don't know what will fail. Agreed. > I have tweaked the reindex tests to run with all 3 different levels > so at least these code paths get exercised. Thanks, all four pushed to 'master' on https://public-inbox.org/ along with my flush threshold env check. I think being able to transition from an existing "basic" to (full|medium) can be straightforward, too, with the untested patch below. But most other transitions between levels will require an expensive --reindex. (full|medium) => basic would be easy, too, but it'll be up to the user to remove the Xapian files. diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index bb60506..620f24d 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -714,7 +714,7 @@ sub _index_sync { } $dbh->commit; } - if ($mkey && $newest) { + if ($mkey && $newest && $self->{indexlevel} ne 'basic') { my $cur = $xdb->get_metadata($mkey); if (need_update($self, $cur, $newest)) { $xdb->set_metadata($mkey, $newest);