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 1209B1F597; Wed, 18 Jul 2018 10:15:32 +0000 (UTC) Date: Wed, 18 Jul 2018 10:15:31 +0000 From: Eric Wong To: "Eric W. Biederman" Cc: meta@public-inbox.org Subject: Re: [PATCH] SearchIdx: Decrement regen_down even for added messages that are later deleted. Message-ID: <20180718101531.4abxuxjtv7kmqrk3@whir> References: <87wottjz52.fsf@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87wottjz52.fsf@xmission.com> List-Id: "Eric W. Biederman" wrote: > Decrement regen_down when visiting messages that appear in %D that we > know will later be deleted. This ensures consistent message numbers are > generated no matter which commit number is on top. Allowing deletes to > propagage separately from the messages they delete without causing > problems. Thanks! I completely forgot I did regen_down for 017fed7bc4d33ac474a19356994be5bd0bfe68ba > The v2 trees already do this and when the indexes are deleted and > rebuilt they maintain they commit numbers. > > Add a v1 version of the v2reindex test to verify that reindexing is > working properly on v1 as well as v2. I noticed a few minor nits in the test, so I will squash the following in to quiet down git-init and ensure warnings are tested: diff --git a/t/v1reindex.t b/t/v1reindex.t index 7b8d883..0df36d3 100644 --- a/t/v1reindex.t +++ b/t/v1reindex.t @@ -15,7 +15,7 @@ foreach my $mod (qw(DBD::SQLite Search::Xapian)) { use_ok 'PublicInbox::SearchIdx'; use_ok 'PublicInbox::Import'; my $mainrepo = tempdir('pi-v1reindex-XXXXXX', TMPDIR => 1, CLEANUP => 1); -is(system(qw(git init --bare), $mainrepo), 0); +is(system(qw(git init -q --bare), $mainrepo), 0); my $ibx_config = { mainrepo => $mainrepo, name => 'test-v1reindex', @@ -79,7 +79,7 @@ $rw = PublicInbox::SearchIdx->new($ibx, 1); ok(!-d $xap, 'Xapian directories removed again'); { my @warn; - #local $SIG{__WARN__} = sub { push @warn, @_ }; + local $SIG{__WARN__} = sub { push @warn, @_ }; eval { $rw->index_sync({reindex => 1}) }; is($@, '', 'no error from reindexing without msgmap'); is(scalar(@warn), 0, 'no warnings from reindexing');