about summary refs log tree commit homepage
path: root/lib/PublicInbox/OverIdx.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-10-20 22:05:05 +0000
committerEric Wong <e@80x24.org>2019-10-21 10:50:31 +0000
commit8742421ba3503e1865b9f1a2561318e3a58c4b3c (patch)
tree7149f9373dfff45ce58d643c1ef89918da9a34ba /lib/PublicInbox/OverIdx.pm
parente4be18b4f9b39aa58bebdbe00f0f7c8a65f1f82d (diff)
downloadpublic-inbox-8742421ba3503e1865b9f1a2561318e3a58c4b3c.tar.gz
And maybe 8-headered ones, too...

I noticed --reindex failing on the linux-renesas-soc mirror due
one 3-headed monster of a message having 3 sets of headers;
while another normal message had a Message-ID that matched one
of the 3 IDs of the 3-headed monster.

We still try to do the majority of indexing backwards, but we
defer indexing multi-Message-ID'd messages until the end to
ensure we get all the "good" messages in before we process the
multi-headered ones.

Link: https://public-inbox.org/meta/20191016211415.GA6084@dcvr/
Diffstat (limited to 'lib/PublicInbox/OverIdx.pm')
-rw-r--r--lib/PublicInbox/OverIdx.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/PublicInbox/OverIdx.pm b/lib/PublicInbox/OverIdx.pm
index 7fd1905d..64277342 100644
--- a/lib/PublicInbox/OverIdx.pm
+++ b/lib/PublicInbox/OverIdx.pm
@@ -343,6 +343,20 @@ sub remove_oid {
         $nr;
 }
 
+sub num_mid0_for_oid {
+        my ($self, $oid, $mid) = @_;
+        my ($num, $mid0);
+        $self->begin_lazy;
+        each_by_mid($self, $mid, ['ddd'], sub {
+                my ($smsg) = @_;
+                my $blob = $smsg->{blob};
+                return 1 if (!defined($blob) || $blob ne $oid); # continue;
+                ($num, $mid0) = ($smsg->{num}, $smsg->{mid});
+                0; # done
+        });
+        ($num, $mid0);
+}
+
 sub create_tables {
         my ($dbh) = @_;