Resource already exists exception throws after delete the index and create it again immediately

Hi Team,

I am experiencing an intermittent issue. If I delete an index and create it again immediately , ES will throws resource_already_exists_exception:

[48258390003131ec/mrHqvHQFSXWktcONr3iigA] ElasticsearchStatusException[Elasticsearch exception [type=resource_already_exists_exception, reason=index [48258390003131ec/mrHqvHQFSXWktcONr3iigA] already exists]]

I have code to check if index exists (by calling client.indices().exists) between the delete and create operation. I do create index only I got false from the call client.indices() . But sometime I still get resource_already_exists_exception.

And I am using version 6.5.4 REST High Level client.

Any thoughts on this will be very appreciated.

2 Likes

I noticed the DeleteIndexRequest could set IndicesOptions as follow:

dReq.indicesOptions(IndicesOptions.strictExpand());

The question is if I don't set the IndicesOptions, what's the default value ?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.