Skip to content

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

Closed
@astefan

Description

@astefan

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.

Metadata

Metadata

Assignees

Labels

:Distributed Indexing/CRUDA catch all label for issues around indexing, updating and getting a doc by id. Not search.>bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions