Skip to content

fix(lucene): isolate lock factories for concurrent directory creation - #501

Merged
lxy-9602 merged 2 commits into
apache:mainfrom
lszskye:fix_1103
Nov 3, 2026
Merged

lxy-9602 merged 2 commits into
apache:mainfrom
lszskye:fix_1103

Conversation

@lszskye

@lszskye lszskye commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Purpose

Linked issue: #500

Allocate a separate NoLockFactory for each reader and writer directory.
The singleton factory shares a mutable lockPrefix that Directory::
setLockFactory updates without synchronization, causing a data race
and potential double-free during concurrent directory creation.

Add a multithreaded regression test verifying that each directory
retains its own distinct lock prefix.

Tests

src/paimon/global_index/lucene/lucene_directory_test.cpp

Generative AI tooling

Generated-by: OpenAI Codex

lxy-9602
lxy-9602 previously approved these changes Nov 3, 2026

@lxy-9602 lxy-9602 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@SteNicholas SteNicholas left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lszskye, I left two comments on writer-side regression coverage and documenting why lock factories must be isolated. PTAL.

@SteNicholas SteNicholas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@lxy-9602
lxy-9602 merged commit 4033fa3 into apache:main Nov 3, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants