Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versioning: Add a new version_type parameter, with a new type - `external` #776

Closed
kimchy opened this issue Mar 12, 2011 · 4 comments

Comments

@kimchy
Copy link
Member

commented Mar 12, 2011

Add a new version_type parameter, supporting a new versioning behavior. The current versioning behavior is called internal, the new one named external.

The external version type allows to provide an external numeric version value (that might be maintained by an external system, like optimistic locking logic in a database).

When provided, by setting the version value and the version_type to external, the check will be if the provided version is greater than the current document version. If so, it will be set as the document version value and the document will be indexed. If the current document version is higher than the provided version, a version conflict will be returned / thrown.

This means that async indexing as a result of operations done against the database can use the database versioning scheme and there is no need to maintain strict ordering in the async indexing process.

Or even the simple case of updating the db, and then indexing into elasticsearch is now simplified since if the indexing gets out of order, the external versioning can be used to make sure only the latest version is indexed.

@kimchy

This comment has been minimized.

Copy link
Member Author

commented Mar 12, 2011

Versioning: Add a new version_type parameter, with a new type - external, closed by bdb0fd2.

@apatrida

This comment has been minimized.

Copy link
Contributor

commented May 21, 2011

Does versioning work on deletes by id? For an example with an external version number, you will only want to delete if the version number is less than that of the delete (i.e. assuming it is a timestamp). If it isn't, you want the delete to fail. Optimistic concurrency should work in deletes, not just updates.

@kimchy

This comment has been minimized.

Copy link
Member Author

commented May 21, 2011

It does, but deletes gets expunged after a certain time.

@apatrida

This comment has been minimized.

Copy link
Contributor

commented May 21, 2011

so a delete itself can be blocked by a higher version in the existing record?

and a delete can block an update by having its own version set (external) than an incoming update?

If both are true, then dandy. Only expunging breaks the protection...

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.