version_conflict_engine_exception
We're using ElasticSearch as a Cache and when we run a stress test with 10 processes simultaneously accessing and writing to ES we occasionally get a version_conflict_engine_exception
exception. This is strange since we are not working with versions and do not provide a _version
field. The last write should just win.
How can we avoid this problem or should we just ignore it?
We are using the NPM Package for ElasticSearch Client.
Request
PUT /mycache/_create/XYZ30034501 HTTP/1.1
{"part":"XYZ-30034-501","timestamp":"2019-09-27T06:23:09.209Z"}
Response
HTTP/1.1 409 Conflict
content-type: application/json; charset=UTF-8
content-length: 457
{
"error": {
"root_cause": [
{
"type": "version_conflict_engine_exception",
"reason": "[XYZ30034501]: version conflict, document already exists (current version [1])",
"index_uuid": "UoYuAeWUTiaIhJkYiPs72g",
"shard": "0",
"index": "partcache-dev1"
}
],
"type": "version_conflict_engine_exception",
"reason": "[XYZ30034501]: version conflict, document already exists (current version [1])",
"index_uuid": "UoYuAeWUTiaIhJkYiPs72g",
"shard": "0",
"index": "partcache-dev1"
},
"status": 409
}