Skip to content
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

Fix null indexFieldMap bug & add UTs #214

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

dzane17
Copy link
Collaborator

@dzane17 dzane17 commented Jan 27, 2025

Description

Fixes null pointer bug when invalidating an index which has no cache entries.

[2025-01-23T22:32:47,810][WARN ][o.o.c.s.ClusterApplierService] [integTest-1] failed to notify ClusterStateListener
java.lang.NullPointerException: Cannot read field "fieldTypeMap" because "indexFieldMap" is null
java.lang.NullPointerException: Cannot read field "fieldTypeMap" because "indexFieldMap" is null
        at org.opensearch.plugin.insights.core.service.categorizer.IndicesFieldTypeCache.invalidate(IndicesFieldTypeCache.java:71) ~[?:?]
        at org.opensearch.plugin.insights.core.service.categorizer.IndicesFieldTypeCache.invalidate(IndicesFieldTypeCache.java:71) ~[?:?]
        at org.opensearch.plugin.insights.core.service.categorizer.QueryShapeGenerator.clusterChanged(QueryShapeGenerator.java:64) ~[?:?]
        at org.opensearch.plugin.insights.core.service.categorizer.QueryShapeGenerator.clusterChanged(QueryShapeGenerator.java:64) ~[?:?]
        at org.opensearch.cluster.service.ClusterApplierService.callClusterStateListener(ClusterApplierService.java:662) [opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
        at org.opensearch.cluster.service.ClusterApplierService.callClusterStateListener(ClusterApplierService.java:662) [opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
        at org.opensearch.cluster.service.ClusterApplierService.callClusterStateListeners(ClusterApplierService.java:648) [opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
        at org.opensearch.cluster.service.ClusterApplierService.callClusterStateListeners(ClusterApplierService.java:648) [opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
        at org.opensearch.cluster.service.ClusterApplierService.applyChanges(ClusterApplierService.java:606) [opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
        at org.opensearch.cluster.service.ClusterApplierService.applyChanges(ClusterApplierService.java:606) [opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
        at org.opensearch.cluster.service.ClusterApplierService.runTask(ClusterApplierService.java:510) [opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
        at org.opensearch.cluster.service.ClusterApplierService.runTask(ClusterApplierService.java:510) [opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
        at org.opensearch.cluster.service.ClusterApplierService$UpdateTask.run(ClusterApplierService.java:205) [opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
        at org.opensearch.cluster.service.ClusterApplierService$UpdateTask.run(ClusterApplierService.java:205) [opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
        at org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:932) [opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
        at org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:932) [opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
        at 

Issues Resolved

List any issues this PR will resolve, e.g. Closes [...].

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@dzane17 dzane17 marked this pull request as ready for review January 27, 2025 21:08
@ansjcy ansjcy merged commit 24a8bbc into opensearch-project:main Jan 27, 2025
12 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 27, 2025
Signed-off-by: David Zane <[email protected]>
(cherry picked from commit 24a8bbc)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ansjcy pushed a commit that referenced this pull request Jan 27, 2025
(cherry picked from commit 24a8bbc)

Signed-off-by: David Zane <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@dzane17 dzane17 deleted the ft-cache-bug branch January 27, 2025 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants