about summary refs log tree commit homepage
path: root/lib/PublicInbox/Mbox.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-08-22 06:06:27 +0000
committerEric Wong <e@yhbt.net>2020-08-23 00:19:53 +0000
commita367ec1b15a2458e532245f5308565dd84f8ca63 (patch)
tree97f5c7fc52301282ff9a5f1c9913f3827edd3b49 /lib/PublicInbox/Mbox.pm
parentaad1b9e70529b78d3d7d62b0920ad82ca40f9592 (diff)
downloadpublic-inbox-a367ec1b15a2458e532245f5308565dd84f8ca63.tar.gz
mbox: disable "&t" on existing Xapian until full reindex
Expanding threads via over.sqlite3 for mbox.gz downloads without
Xapian effectively collapsing on the THREADID column leads to
repeated messages getting downloaded.

To avoid that situation, use a "has_threadid" Xapian metadata
flag that's only set on --reindex (and brand new Xapian DBs).

This allows admins to upgrade WWW or do --reindex in any order;
without worrying about users eating up bandwidth and CPU cycles.
Diffstat (limited to 'lib/PublicInbox/Mbox.pm')
-rw-r--r--lib/PublicInbox/Mbox.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm
index c9b11c21..0223bead 100644
--- a/lib/PublicInbox/Mbox.pm
+++ b/lib/PublicInbox/Mbox.pm
@@ -262,7 +262,7 @@ sub mbox_all {
         $ctx->{ids} = $srch->mset_to_artnums($mset);
         require PublicInbox::MboxGz;
         my $fn;
-        if ($q->{t}) {
+        if ($q->{t} && $srch->has_threadid) {
                 $fn = 'results-thread-'.$q_string;
                 PublicInbox::MboxGz::mbox_gz($ctx, \&results_thread_cb, $fn);
         } else {