]> Sergey Matveev's repositories - public-inbox.git/commit
extsearch: unconditionally reopen on access
authorEric Wong <e@80x24.org>
Sun, 27 Dec 2020 11:01:41 +0000 (11:01 +0000)
committerEric Wong <e@80x24.org>
Mon, 28 Dec 2020 23:18:48 +0000 (23:18 +0000)
commitd209c2064ebc8ccddc7f0da068c663fc08077334
tree22f61072fa9b1e5ae01fb3bfb42a4ffbfadc8868
parente411f4465dd26d8b09d005224a8ead7056e6e532
extsearch: unconditionally reopen on access

Since ExtSearch lacks the janky cleanup timer of
PublicInbox::Inbox objects, its search results get stale.

Reopen the Xapian DB on every ->search call for now, as
reducing reopen calls doesn't seem worth the complexity.

The Xapian::Database::reopen operation itself takes only ~50us
on my old workstation with 3 shards totaling <200GB.  Other
parts of Xapian dominates the search time, so the reopen seems
inconsequential with single-digit shard counts.
lib/PublicInbox/ExtSearch.pm