about summary refs log tree commit homepage
path: root/lib/PublicInbox/V2Writable.pm
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2018-08-01 11:43:44 -0500
committerEric Wong <e@80x24.org>2018-08-03 20:04:29 +0000
commit72fa722146912781230c54d7282bf7c1147e0455 (patch)
tree6d3c672a86d2cbd311147c8664ac33df12f0a212 /lib/PublicInbox/V2Writable.pm
parent65820d88976bc2fa83e9acd3b460ac304578d40a (diff)
downloadpublic-inbox-72fa722146912781230c54d7282bf7c1147e0455.tar.gz
Now that we track the num highwater mark it is safe to remove messages
from msgmap that have been previously allocated.  Removing even the
highest numbered article will no longer cause new message numbers to
move backwards.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'lib/PublicInbox/V2Writable.pm')
-rw-r--r--lib/PublicInbox/V2Writable.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm
index 4dd14331..0396d9f5 100644
--- a/lib/PublicInbox/V2Writable.pm
+++ b/lib/PublicInbox/V2Writable.pm
@@ -842,7 +842,10 @@ sub unindex_oid {
                         warn "BUG: multiple articles linked to $oid\n",
                                 join(',',sort keys %gone), "\n";
                 }
-                $self->{unindexed}->{$_}++ foreach keys %gone;
+                foreach my $num (keys %gone) {
+                        $self->{unindexed}->{$_}++;
+                        $self->{mm}->num_delete($num);
+                }
                 $self->unindex_oid_remote($oid, $mid);
         }
 }