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 544F11FAE5 for ; Fri, 30 Mar 2018 01:20:49 +0000 (UTC) From: "Eric Wong (Contractor, The Linux Foundation)" To: meta@public-inbox.org Subject: [PATCH 3/9] v2writable: convert some fatal reindex errors to warnings Date: Fri, 30 Mar 2018 01:20:42 +0000 Message-Id: <20180330012048.15985-4-e@80x24.org> In-Reply-To: <20180330012048.15985-1-e@80x24.org> References: <20180330012048.15985-1-e@80x24.org> List-Id: By supporting purge and allowing users to delete git partitions, we can open up ourselves to gaps and un-reindexible data. Let that be. --- lib/PublicInbox/V2Writable.pm | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index 6394d30..269b028 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -552,7 +552,7 @@ sub reindex_oid { $num = $$regen--; die "BUG: ran out of article numbers\n" if $num <= 0; my $mm = $self->{skel}->{mm}; - foreach my $mid (@$mids) { + foreach my $mid (reverse @$mids) { if ($mm->mid_set($num, $mid) == 1) { $mid0 = $mid; last; @@ -560,7 +560,11 @@ sub reindex_oid { } if (!defined($mid0)) { my $id = '<' . join('> <', @$mids) . '>'; - warn "Message-Id $id unusable for $num\n"; + warn "Message-ID $id unusable for $num\n"; + foreach my $mid (@$mids) { + defined(my $n = $mm->num_for($mid)) or next; + warn "#$n previously mapped for <$mid>\n"; + } } } @@ -661,8 +665,17 @@ sub reindex { } delete $self->{reindex_pipe}; } + my $gaps; + if ($regen && $$regen != 0) { + warn "W: leftover article number ($$regen)\n"; + $gaps = 1; + } my ($min, $max) = $mm_tmp->minmax; - defined $max and die "leftover article numbers at $min..$max\n"; + if (defined $max) { + warn "W: leftover article numbers at $min..$max\n"; + $gaps = 1; + } + warn "W: were old git partitions deleted?\n" if $gaps; my @d = sort keys %$D; if (@d) { warn "BUG: ", scalar(@d)," unseen deleted messages marked\n"; -- EW