DBAtlas · Database operations atlas

version_conflict_engine_exception: version_conflict_engine_exception: [_doc][id]: version conflict, current version [x] is different than the one provided [y] (HTTP 409)

Elasticsearch

What 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).

Open in DBAtlas →

More from this engine