]> git.ipfire.org Git - thirdparty/public-inbox.git/commit
extindex: fix --reindex
authorEric Wong <e@80x24.org>
Fri, 12 Sep 2025 23:28:18 +0000 (23:28 +0000)
committerEric Wong <e@80x24.org>
Sat, 13 Sep 2025 07:38:52 +0000 (07:38 +0000)
commit9011547f607e20aae22d84b710e4b83088a35223
treeb0404a554a91dc71b57d30bcf0cbac6e3b94160f
parent2baa916e55b234aefa7ac4c9060f91937dea6fe3
extindex: fix --reindex

`public-inbox-extindex --reindex' deprioritizes itself for
public-inbox-extindex invocations without --reindex by shutting
down shard processes to let other processes acquire the lock and
process new messages, first.

Restarting shard processes during --reindex was causing new
Xapian shards to be written to v2 inboxes instead of the
extindex itself.  This bug was introduced with the
simplifications to internal data structures to eliminate the
ad-hoc $sync structure.

The local-ized use of ExtSearchIdx->{ibx} tricked
PublicInbox::SearchIdxShard::new into using the standard v2 code
path.  So make SearchIdxShard->new check the `$v2w' object for
the ability to call `eidx_sync' rather than the existence of the
{ibx} field.

I only noticed this bug while working on the --split-shards
feature for performance.

Fixes: 922b765d ((ext)index: move {max_size} and related bits to $self, 2025-01-10)
lib/PublicInbox/SearchIdxShard.pm
t/extsearch.t