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

etcdserver: reject v3 txns with duplicate put keys #4376

Merged

Conversation

heyitsanthony
Copy link
Contributor

An API check to support PR #4363; bad requests didn't return an error.


// checkRequestPutKeys gives ErrDuplicateKey if the same key is put twice
func checkRequestPutKeys(reqs []*pb.RequestUnion) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not allow put then delete too, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, will fix

@xiang90
Copy link
Contributor

xiang90 commented Feb 2, 2016

Cannot sleep early recently for no reason. etcd night club formed.

@heyitsanthony
Copy link
Contributor Author

all fixed ptal /cc @xiang90

@xiang90
Copy link
Contributor

xiang90 commented Feb 2, 2016

LGTM

@heyitsanthony
Copy link
Contributor Author

ok merging on greenlight

An API check to support PR etcd-io#4363; bad requests didn't return an error.
heyitsanthony pushed a commit that referenced this pull request Feb 2, 2016
etcdserver: reject v3 txns with duplicate put keys
@heyitsanthony heyitsanthony merged commit 71e000d into etcd-io:master Feb 2, 2016
@heyitsanthony heyitsanthony deleted the txn-no-duplicate-putkey branch February 3, 2016 18:18
fuweid added a commit to fuweid/etcd that referenced this pull request Jul 14, 2024
In commit [[1]], the newTestKeyIndex function creates one key with two
Revision{Main: 14} revisions. However, starting from version [[2]], etcd server
does not allow duplicate keys in a single transaction. This update to
newTestKeyIndex is to avoid confusion and ensure consistency with the
latest etcd server behavior.

REF:

[1]: etcd-io@be80d11
[2]: etcd-io#4376

Signed-off-by: Wei Fu <fuweid89@gmail.com>
ah8ad3 pushed a commit to ah8ad3/etcd that referenced this pull request Jul 23, 2024
In commit [[1]], the newTestKeyIndex function creates one key with two
Revision{Main: 14} revisions. However, starting from version [[2]], etcd server
does not allow duplicate keys in a single transaction. This update to
newTestKeyIndex is to avoid confusion and ensure consistency with the
latest etcd server behavior.

REF:

[1]: etcd-io@be80d11
[2]: etcd-io#4376

Signed-off-by: Wei Fu <fuweid89@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants