Skip to content

Conversation

@ohadzeliger
Copy link
Contributor

Lucene partitioner is not thread safe when records are updated concurrently.
The partition count and boundaries are not thread safe and can skew in multi threaded updates.
The changes include protecting the partition metadata changes with a keyspace lock.
The LuceneIndexMaintenanceTest.concurrent* tests have been extended to run in partitioned setup and are now passing.
In addition, a bug where empty partitions were not removed was uncovered, and a fix was introduced, with accompanying tests. Empty partitions (first, middle and last) are removed with their index data, ensuring at least one partition is always left behind.

Resolves #2990

ScottDugas and others added 4 commits October 23, 2025 15:28
This changes the concurrentUpdate to run with a single partition,
and adds usages of AsyncLock to ensure that updates to the partition
metadata work correctly.
Before calling the issue complete an additional test should be added
that does concurrent inserts, and one for concurrent deletes.
@ohadzeliger ohadzeliger self-assigned this Oct 28, 2025
@ohadzeliger ohadzeliger added the bug fix Change that fixes a bug label Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix Change that fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LucenePartitioner is not thread safe if multiple independent records are updated concurrently

2 participants