version_conflict_engine_exception: version_conflict_engine_exception: [_doc][id]: version conflict, current version [x] is different than the one provided [y] (HTTP 409)
ElasticsearchWhat does it mean?
A document update/delete request was rejected by optimistic concurrency control. The document version (or _seq_no/_primary_term) does not match the one in the request; that is, someone else modified the document after you read it. Returns HTTP 409.
Why does it happen?
Concurrent updates to the same document, a write attempted with a stale version/seq_no, an attempt to create (op_type=create) a document that already exists, or a race condition during _bulk.
How to fix it
Re-read the document and retry the request with the current _seq_no and _primary_term (or version) (read-modify-write loop). For automatic retries use the retry_on_conflict parameter on the _update request; in _update_by_query/_delete_by_query pass conflicts=proceed to skip conflicting documents and continue. If the intent is create-only, the conflict is normal; catch 409 in the application and handle it appropriately (retry or skip).
More from this engine
- illegal_argument_exception_fielddataillegal_argument_exception: Fielddata is disabled on text fields by default. Set fielddata=true on [your_field] in order to load fielddata in memory
- search_phase_execution_exceptionsearch_phase_execution_exception: all shards failed / Failed to execute phase [query]
- too_many_clausestoo_many_clauses: maxClauseCount is set to 1024 (query contains too many clauses)
- document_missing_exceptiondocument_missing_exception: [_doc][id]: document missing
- index_not_found_exceptionindex_not_found_exception: no such index [index_name] (HTTP 404)
- resource_already_exists_exceptionresource_already_exists_exception: index [index_name/uuid] already exists (HTTP 400)
- cluster_health_redcluster health status: RED / unassigned shards