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: AS6315 166.70.0.0/16 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_LOW,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.1 Received: from out02.mta.xmission.com (out02.mta.xmission.com [166.70.13.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 1832F1F597; Thu, 19 Jul 2018 18:47:25 +0000 (UTC) Received: from in02.mta.xmission.com ([166.70.13.52]) by out02.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fgDxT-0005zr-Oy; Thu, 19 Jul 2018 12:47:23 -0600 Received: from [97.119.167.31] (helo=x220.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fgDxE-0007VP-CN; Thu, 19 Jul 2018 12:47:23 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Eric Wong Cc: meta@public-inbox.org 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> <20180719035202.qqertfmrxa4zlvmo@whir> Date: Thu, 19 Jul 2018 13:47:01 -0500 In-Reply-To: <20180719035202.qqertfmrxa4zlvmo@whir> (Eric Wong's message of "Thu, 19 Jul 2018 03:52:03 +0000") Message-ID: <877elrf4gq.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1fgDxE-0007VP-CN;;;mid=<877elrf4gq.fsf@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=97.119.167.31;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+BmGz8o2PqGO+GxmxFatX31Surbgg9RJY= X-SA-Exim-Connect-IP: 97.119.167.31 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: [PATCH v2 1/3] Making the search indexes optional X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) List-Id: Eric Wong writes: > "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. I would still use "$self->{indexlevel} =~ m/(full|medium)/" instead of ne 'basic' just in case we start recognizing another level. Otherwise your change seems to make sense. I have not really dug into the reindex case where the point is to pick up things that were previously missed. I can definitely see that code should be guarded with an indexlevel check. Eric > 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);