Skip to content

Fix data race in InlineStats #131370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 17, 2025
Merged

Fix data race in InlineStats #131370

merged 2 commits into from
Jul 17, 2025

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Jul 16, 2025

Although blocks/vectors are immutable and safe to share between threads, their references are currently not thread-safe, which can lead to data races. Previously, blocks/vectors were exclusively owned by a single thread, but this is no longer always the case with InlineJoin. We should consider switching to AbstractRefCounted, which is thread-safe, and benchmark it with many-fields use cases to ensure there is no performance regression. As a temporary solution, this change clones the values block in InlineJoin until thread-safe blocks/vectors are available.

@elasticsearchmachine elasticsearchmachine added v9.2.0 serverless-linked Added by automation, don't add manually labels Jul 16, 2025
@dnhatn dnhatn requested review from nik9000 and astefan July 16, 2025 15:50
@dnhatn dnhatn marked this pull request as ready for review July 16, 2025 15:50
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Jul 16, 2025
Copy link
Contributor

@astefan astefan left a comment

Choose a reason for hiding this comment

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

Thank you for the information and details about the source of the original issue.
It LGTM but likely @nik9000's review is the relevant one :-)).

@dnhatn
Copy link
Member Author

dnhatn commented Jul 17, 2025

@astefan @nik9000 Thanks!

@dnhatn dnhatn merged commit 78f6133 into elastic:main Jul 17, 2025
33 checks passed
@dnhatn dnhatn deleted the fix-inline-join branch July 17, 2025 18:10
nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Jul 17, 2025
elasticsearchmachine pushed a commit that referenced this pull request Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >non-issue serverless-linked Added by automation, don't add manually Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants