diff options
author | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-26 19:09:08 +0000 |
---|---|---|
committer | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-27 02:34:25 +0000 |
commit | f1e830d8fea4f22e12012d97f3619d54a3c3c08c (patch) | |
tree | 7b8534a07ddd3fd6af0528354530beee0f2551ff /lib | |
parent | 2f5bb422a75f38e9c2fdca5d526fd8832ca9de45 (diff) | |
download | public-inbox-f1e830d8fea4f22e12012d97f3619d54a3c3c08c.tar.gz |
It would be a bug to have deleted files marked but not seen in our histories.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/V2Writable.pm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index b04e6fbf..01ec98ac 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -495,7 +495,7 @@ sub mark_deleted { my $mids = mids($mime->header_obj); my $cid = content_id($mime); foreach my $mid (@$mids) { - $D->{$mid.$cid} = 1; + $D->{"$mid\0$cid"} = 1; } } @@ -513,7 +513,7 @@ sub reindex_oid { my $num = -1; my $del = 0; foreach my $mid (@$mids) { - $del += (delete $D->{$mid.$cid} || 0); + $del += (delete $D->{"$mid\0$cid"} || 0); my $n = $mm_tmp->num_for($mid); if (defined $n && $n > $num) { $mid0 = $mid; @@ -633,6 +633,14 @@ sub reindex { } my ($min, $max) = $mm_tmp->minmax; defined $max and die "leftover article numbers at $min..$max\n"; + my @d = sort keys %$D; + if (@d) { + warn "BUG: ", scalar(@d)," unseen deleted messages marked\n"; + foreach (@d) { + my ($mid, undef) = split(/\0/, $_, 2); + warn "<$mid>\n"; + } + } } 1; |