From: Eric W. Biederman Date: Wed, 1 Aug 2018 16:43:43 +0000 (-0500) Subject: V2Writeable.pm: Ensure that a found message number is in the msgmap X-Git-Tag: v1.2.0~469^2~1 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=65820d88976bc2fa83e9acd3b460ac304578d40a;p=public-inbox.git V2Writeable.pm: Ensure that a found message number is in the msgmap The lookup to see if a num has already been assigned to a message happens in a temporary copy of message map. It is possible that the number has been removed from the current message map. The unindex/reindex after a history rewrite triggered by a purge should be one such case. Therefore add the number to the msgmap in case it is not currently present. Signed-off-by: "Eric W. Biederman" --- diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index 92d2672c..4dd14331 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -676,6 +676,7 @@ sub reindex_oid { if (defined $n && $n > $num) { $mid0 = $mid; $num = $n; + $self->{mm}->mid_set($num, $mid0); } } if (!defined($mid0) && $regen && !$del) {