I am trying to find a way for recreating the shard failure in Elasticsearch
When querying ES can return a 200 response , even if one of the shards had failed to respond.
how do I recreate error, for testing.
HI, thanks for asking. For now, I have removed the elastic-stack-alerting label as I don't follow how it relates. I could guess you are doing this testing in the context of some alerts usage? It may help later, but the core question seems unrelated so I'm not deep enough into Elasticsearch to be able to help.
We can ask another team for help on this if you can offer more content - and someone will write back either way, I expect. Let us know. Cheers.
Hello, I'm on the Elasticsearch team and may be able to help.
To check, are you trying to simulate the situation in automated tests where only a few shards fail (so you get a partial response)? One option is to create two indices containing some field "field", one with the "field" mapped as "integer", and the other as "keyword". Then you could search across both indices using a "range" query on some non-numeric value -- it will fail on the index shards where the field is mapped as "integer" with a parsing exception.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.