Skip to content

Fix NPE in dense_vector stats#112720

Merged
dnhatn merged 2 commits intoelastic:mainfrom
dnhatn:stats-npe
Sep 10, 2024
Merged

Fix NPE in dense_vector stats#112720
dnhatn merged 2 commits intoelastic:mainfrom
dnhatn:stats-npe

Conversation

@dnhatn
Copy link
Copy Markdown
Member

@dnhatn dnhatn commented Sep 10, 2024

If a segment doesn't contain any documents with a dense_vector field, but the mapping defines it, an NPE can occur when retrieving the dense_vector stats.

Relates #111729

@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Hi @dnhatn, I've created a changelog YAML for you.

@dnhatn dnhatn requested a review from benwtrent September 10, 2024 21:28
@dnhatn dnhatn marked this pull request as ready for review September 10, 2024 21:28
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search-relevance (Team:Search Relevance)

@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Sep 10, 2024
@dnhatn
Copy link
Copy Markdown
Member Author

dnhatn commented Sep 10, 2024

Thanks @benwtrent

@dnhatn dnhatn merged commit f19e488 into elastic:main Sep 10, 2024
@dnhatn dnhatn deleted the stats-npe branch September 10, 2024 22:28
dnhatn added a commit to dnhatn/elasticsearch that referenced this pull request Sep 10, 2024
If a segment doesn't contain any documents with a dense_vector field, 
but the mapping defines it, an NPE can occur when retrieving the
dense_vector stats.

Relates elastic#111729
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

💚 Backport successful

Status Branch Result
8.15

elasticsearchmachine pushed a commit that referenced this pull request Sep 10, 2024
If a segment doesn't contain any documents with a dense_vector field, 
but the mapping defines it, an NPE can occur when retrieving the
dense_vector stats.

Relates #111729
@Philippus
Copy link
Copy Markdown
Contributor

Can the issue that was fixed here be the cause of this error we are getting when we're issuing a GET _nodes/stats command?

      {
        "type": "failed_node_exception",
        "reason": "Failed node [...]",
        "node_id": "...",
        "caused_by": {
          "type": "null_pointer_exception",
          "reason": """Cannot invoke "org.apache.lucene.index.FieldInfo.getVectorDimension()" because "info" is null"""
        }
      },

@jimczi
Copy link
Copy Markdown
Contributor

jimczi commented Sep 16, 2024

That's correct @Philippus, this PR is the fix for this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v8.15.2 v8.16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants