Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Versioning #594

Closed
kimchy opened this Issue Jan 4, 2011 · 1 comment

Comments

Projects
None yet
1 participant
Owner

kimchy commented Jan 4, 2011

The versioning feature allows to handle conflicts when doing a get/search and then index/delete. Each document has a version number, and each index and delete (tombstone) increase the version number.

A conflict is detected when providing a version parameter to the index/delete request and there is a mismatch between the version provided and the real time version of the current document. If a version number is not provided, then the operation is forced without doing any version check.

Search and get operations return the version number associated with the hit under _version. Note, the version number reflects the near real time status of the search. In other words, the version number will point to the doc when the index was last refreshed.

Nice side affects of this feature include returning on delete if the document was actually found or not, as well as fixing a rare out of order replication sync between a primary and its replica (under heavy changes of the same doc within a short period of time).

Added features include:

  1. Index with create flag will now fail if there is already an indexed doc. This basically allows to use create as a putIfAbsent logic.
  2. Indexing a document that does not exists will be as fast as with create flag set to true. So no need to set it anymore to improve fresh data indexing performance.

The bulk operation supports providing a version number as well using _version on each bulk item.

Upgrade Notes

The versioning support is backward compatible, though only new operations on documents will cause the versioning system to start and kick in for that doc.

Owner

kimchy commented Jan 4, 2011

Versioning, closed by 45c1ab0.

@tallpsmith tallpsmith pushed a commit to tallpsmith/elasticsearch that referenced this issue May 5, 2011

@kimchy kimchy Versioning, closes #594. 45c1ab0

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment