-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Ignore conflicting concurrent storage writes of the same data with version="*" #1118
Conversation
New query should return success for concurrent writes of identical objects. Had to use |
I see what you mean by "concurrent safe" |
This is a behaviour change which needs to be prominently mentioned in release notes and docs. Previously it was possible to use this operation to create distributed lock/ leader election , now it is still possible but written value must be unique for each node |
After internal discussion, we determined the current behaviour is actually desirable: We may however introduce a new OCC operator at some point that allows the write to succeed if the object already existed but the value was identical. |
Upsert with
DO NOTHING
will ignore insert on conflicting key, instead of failing. The intended upside is that transactions with conflicting inserts will not have to be retried anymore, saving unnecessary database processing.Results do not change, as the new query will still return no rows on conflict, hence the batch insert will be aborted with
ErrStorageRejectedVersion
.