about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchIdx.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-07-24 05:55:47 +0000
committerEric Wong <e@yhbt.net>2020-07-25 20:48:18 +0000
commitb02c7a346bd36f1325518ca110a781c619082da1 (patch)
tree86b3a2868db2996e864bfa94056addc511ae5596 /lib/PublicInbox/SearchIdx.pm
parent0ad076b1943bf7c65868d1db3cef4bd0ea1ef49a (diff)
downloadpublic-inbox-b02c7a346bd36f1325518ca110a781c619082da1.tar.gz
Older versions of public-inbox < 1.3.0 had subtly
different semantics around threading in some corner
cases.  This switch (when combined with --reindex)
allows us to fix them by regenerating associations.
Diffstat (limited to 'lib/PublicInbox/SearchIdx.pm')
-rw-r--r--lib/PublicInbox/SearchIdx.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index 83162509..e641ffd4 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -723,6 +723,7 @@ sub _index_sync {
         my $pr = $opts->{-progress};
 
         my $xdb = $self->begin_txn_lazy;
+        $self->{over}->rethread_prepare($opts);
         my $mm = _msgmap_init($self);
         do {
                 $xlog = undef; # stop previous git-log via SIGPIPE
@@ -761,12 +762,14 @@ sub _index_sync {
                                 $xdb->set_metadata('last_commit', $newest);
                         }
                 }
+
+                $self->{over}->rethread_done($opts) if $newest; # all done
                 $self->commit_txn_lazy;
                 $git->cleanup;
                 $xdb = _xdb_release($self, $nr);
-                # let another process do some work... <
+                # let another process do some work...
                 $pr->("indexed $nr/$self->{ntodo}\n") if $pr && $nr;
-                if (!$newest) {
+                if (!$newest) { # more to come
                         $xdb = $self->begin_txn_lazy;
                         $dbh->begin_work if $dbh;
                 }