Hi!
I have written a module which issues snapshot creation requests for an index and sends it off to a ES cluster. This module is deployed on ECS and can run issue snapshot creation requests concurrently.
Right now, The snapshot creation request looks like,
resp, err := esclient.SnapshotCreate(esRepository, snapshotName).
	WaitForCompletion(true).BodyJson(map[string]interface{}{
	"indices": "indexname",
	"metadata": map[string]string{
		"taken_by": "native_snapshot_ecs_task",
	},
}).Do(context.Background())
if err != nil {
	return time.Since(startTime), err
}
If ES cluster receives multiple requests in parallel, It goes ahead with the one that came first and returns a illegal_state_exception error. (Error 500 (Internal Server Error): trying to modify or unregister repository that is currently used [type=illegal_state_exception]).
Since, I am always only taking snapshot of 1 index/request and no two snapshot creation requests share an index, What can I do to make this all work?
I know there is, include_global_state setting but I am not sure if that is what I should be using?