| #
61dea710
|
| 08-Jul-2026 |
Andreas Gohr <gohr@cosmocode.de> |
fix(search): wait for a contended index lock and apply dperm
The Lock rewrite (c66b5ec65) made Lock::acquire() fail immediately when the lock directory already existed, where the old indexer lock re
fix(search): wait for a contended index lock and apply dperm
The Lock rewrite (c66b5ec65) made Lock::acquire() fail immediately when the lock directory already existed, where the old indexer lock retried until the holder released it. Concurrent saves or indexer runs then aborted indexing instead of serializing (recoverable only via the .indexed tag on the next edit), and the lock directory was created without the configured directory permissions, unlike every other directory DokuWiki creates.
Mirror the io_lock() convention: wait for a contended lock, bounded by a tunable wait timeout, before throwing; keep clearing locks older than five minutes as stale; and chmod the new lock directory to $conf['dperm']. The give-up path still throws IndexLockException, so the self-healing retry via the .indexed tag is unchanged.
show more ...
|
| #
4e61aa71
|
| 05-Jul-2026 |
Andreas Gohr <andi@splitbrain.org> |
fix(search): create index lock directories inside data/locks
Index locks were built by concatenating the configured lock directory and the index name without a path separator.
That produced paths l
fix(search): create index lock directories inside data/locks
Index locks were built by concatenating the configured lock directory and the index name without a path separator.
That produced paths like data/lockspage.index instead of data/locks/page.index, so index lock directories were created in the data root rather than inside the configured lock directory.
Fix this by joining the lock directory and index name with an explicit slash, and update the lock test to assert the correct location and guard against the old broken path.
show more ...
|
| #
ede46466
|
| 06-Apr-2026 |
Andreas Gohr <andi@splitbrain.org> |
SearchIndex: reorganize and expand test suite
Move all Search tests from _test/tests/inc/Search/ to _test/tests/Search/ to match the dokuwiki\test autoloader convention. Fix namespaces from tests\*
SearchIndex: reorganize and expand test suite
Move all Search tests from _test/tests/inc/Search/ to _test/tests/Search/ to match the dokuwiki\test autoloader convention. Fix namespaces from tests\* to dokuwiki\test\* so all tests work in isolation.
Extract inline test helpers into separate autoloadable mock files: TestDirectCollection → MockDirectCollection, TestLookupCollection → MockLookupCollection, TestFrequencyCollection → MockFrequencyCollection.
Rename AbstractIndexTest → AbstractIndexTestCase to fix PHPUnit warning about abstract classes with Test suffix.
Replace dead xxxRealWord() with proper testWildcardSearch() verifying exact token matches and frequencies for all three wildcard types. Add testTokenizedPageSearch() using a dedicated test data file. Add testNoMatchReturnsEmptyFrequencies() which exposed a bug in Term where uninitialized $tokens/$frequencies caused crashes on zero-match terms.
Replace fulltext_query.test.php with modern QueryParserTest in the Search\Query namespace.
Add new test files: - LockTest: acquire/release, reference counting, stale lock override, foreign lock rejection, releaseAll, independent locks - NamespacePredicateTest: filter/exclude, sub-namespaces, partial prefix safety, empty sets, score preservation - PageSetTest: intersect, unite, subtract, isEmpty - QueryEvaluatorTest: word lookups, AND/OR/NOT, namespace filtering, combined queries, partial namespace prefix safety
Fix Term.php: initialize $tokens and $frequencies to [] instead of null.
show more ...
|