Test OpenSearch Shard Failure

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
1.0.3

Describe the issue:
I am little new to OpenSearch, but currently we have decided to go with OpenSearch 1.0.3 ( Java Compatible to our existing system). So as of now system is running fine, but there are few questions in my mind.
I have heard about OpenSearch Index being curropt, or sometimes a failure in shard.

Now, I am not sure if System I have written would handle such cases, and also I found little to almost no details about what exactly happens in such cases.
So, my question to community is, is there a way where I can intentionally fail the shard or corrupt an entire index to test how does the system behave. This would help me come up with a strategy to recover from such errors, and also design a proper flow control

Hi @v3walekar ,

Why did you decide to use version 1.0.3 ?

@Eugene7
I have decided to use 1.0.3 as Libraries above this version were not compatible to my Project’s Java version.
We are currently at Java 8, and OpenSearch 1.0.3 can be deployed with library from version 1.0.0

So for now, this is not a big concern to me, my main concern is understanding how would the failures to shard come, and how can reproduce it, if needed.

You can fail one of the nodes that has a primary shard. This should failover to the replica and make it primary. You can observe that with GET _cat/shards.

You can also change shard behaviour:

@Eugene7 Can you share more pointers on how to fail nodes, I am bit new with OpenSearch

@v3walekar How did you install OpenSearch?

To fail the node, you can stop the OpenSearch service in that node.