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

Query cache is not cleaned up in case of an index creation failure #48186

Closed
astefan opened this issue Oct 17, 2019 · 1 comment · Fixed by #48230
Closed

Query cache is not cleaned up in case of an index creation failure #48186

astefan opened this issue Oct 17, 2019 · 1 comment · Fixed by #48230
Assignees
Labels
>bug :Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search.

Comments

@astefan
Copy link
Contributor

astefan commented Oct 17, 2019

Creating an index with index.mapper.dynamic setting will fail in 7.x with something like

java.lang.IllegalArgumentException: Setting index.mapper.dynamic was removed after version 6.0.0
	at org.elasticsearch.index.mapper.MapperService.<init>(MapperService.java:165) ~[elasticsearch-7.4.0.jar:7.4.0]
	at org.elasticsearch.index.IndexService.<init>(IndexService.java:180) ~[elasticsearch-7.4.0.jar:7.4.0]
	at org.elasticsearch.index.IndexModule.newIndexService(IndexModule.java:411) ~[elasticsearch-7.4.0.jar:7.4.0]
	at org.elasticsearch.indices.IndicesService.createIndexService(IndicesService.java:550) ~[elasticsearch-7.4.0.jar:7.4.0]
	at org.elasticsearch.indices.IndicesService.createIndex(IndicesService.java:499) ~[elasticsearch-7.4.0.jar:7.4.0]

But this seems to introduce a leak by creating the query cache before the index is created, and not cleaning the cache in case of failure. This manifests itself as OptOutQueryCache instances kept alive in heap, each of them referencing the non-existent, attempted-to-be-created-and-failed indexName.

@astefan astefan added >bug :Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. labels Oct 17, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (:Distributed/CRUD)

@DaveCTurner DaveCTurner self-assigned this Oct 18, 2019
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this issue Oct 18, 2019
Today it is possible that we create the `QueryCache` and then fail to create
the owning `IndexService` and this means we do not close the `QueryCache`
again. This commit addresses that leak.

Fixes elastic#48186
DaveCTurner added a commit that referenced this issue Oct 21, 2019
Today it is possible that we create the `QueryCache` and then fail to create
the owning `IndexService` and this means we do not close the `QueryCache`
again. This commit addresses that leak.

Fixes #48186
DaveCTurner added a commit that referenced this issue Oct 21, 2019
Today it is possible that we create the `QueryCache` and then fail to create
the owning `IndexService` and this means we do not close the `QueryCache`
again. This commit addresses that leak.

Fixes #48186
DaveCTurner added a commit that referenced this issue Oct 21, 2019
Today it is possible that we create the `QueryCache` and then fail to create
the owning `IndexService` and this means we do not close the `QueryCache`
again. This commit addresses that leak.

Fixes #48186
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this issue Oct 21, 2019
Today it is possible that we create the `QueryCache` and then fail to create
the owning `IndexService` and this means we do not close the `QueryCache`
again. This commit addresses that leak.

Fixes elastic#48186
DaveCTurner added a commit that referenced this issue Oct 21, 2019
Today it is possible that we create the `QueryCache` and then fail to create
the owning `IndexService` and this means we do not close the `QueryCache`
again. This commit addresses that leak.

Fixes #48186
Backport of #48230
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants