From b02c7a346bd36f1325518ca110a781c619082da1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 24 Jul 2020 05:55:47 +0000 Subject: index: support --rethread switch to fix old indices 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. --- lib/PublicInbox/SearchIdx.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/SearchIdx.pm') 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; } -- cgit v1.2.3-24-ge0c7