Repository navigation
Lucene TermsEnum and PostingsEnum may only be used from acquiring thread - #149297
cimequinox merged 10 commits into
Conversation
|
Hi @cimequinox, I've created a changelog YAML for you. |
🔍 Preview links for changed docs⏳ Building and deploying preview... View progress This comment will be updated with preview links when the build is complete. |
ℹ️ Important: Docs version tagging👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version. We use applies_to tags to mark version-specific features and changes. Expand for a quick overviewWhen to use applies_to tags:✅ At the page level to indicate which products/deployments the content applies to (mandatory) What NOT to do:❌ Don't remove or replace information that applies to an older version 🤔 Need help?
|
|
v9.3.5#bwcTestPart3 build failure appears unrelated. See #149308 |
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
dnhatn
left a comment
There was a problem hiding this comment.
One comment, but the fix looks good. Thanks Cim!
| final int numLeaves = indexReader.leaves().size(); | ||
| final Thread current = Thread.currentThread(); | ||
| final int numLeaves = indexReader.leaves().size(); | ||
| if (termsEnumCache == null || creationThread != current || termsEnumCache.length != numLeaves) { |
There was a problem hiding this comment.
Per an offline discussion with Cim, he will remove the check termsEnumCache.length != numLeaves.
|
Seeing many There are a few hundred Since CI passes for this without |
💚 Backport successful
|
…ches In the non-streaming EnrichQuerySourceOperator, queryPosition is incremented in a slightly different way in the lucene query path and the bulk lookup path. There the ordinary path increments queryPosition before comparing to positionCount but the bulk path increments after the comparison. That's not great but it's not a bug because in that getOutput() the path do not share any logic inspecting it. There each path tests for termination in its own way. But in the LookupQueryOperator, getMatches() and getBulkMatches() share the getOutput() termination condition so they must follow the same convention and increment queryPosition before doing the comparison. This way getOutput() may always safely assume (queryPosition >= positionCount - 1) means we've finished processing the page. This change also removes the call to bulkKeywordLookup.initializeCaches(indexReader) which is no longer necessary since elastic#149297 because we perform that check in each call to processQuery() for thread safety.
Lucene TermsEnum may only consumed on the same thread that acquired it.
Discovered during CI test of #148937
This change corrects the issue by reseting the cache when we detect the current thread differs from the acquiring thread following the example of BlockDocValuesReader.