-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
etcdserver: reject v3 txns with duplicate put keys #4376
Conversation
|
||
// checkRequestPutKeys gives ErrDuplicateKey if the same key is put twice | ||
func checkRequestPutKeys(reqs []*pb.RequestUnion) error { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, will fix
Cannot sleep early recently for no reason. etcd night club formed. |
a30c3ad
to
c0f74e4
Compare
all fixed ptal /cc @xiang90 |
LGTM |
ok merging on greenlight |
An API check to support PR etcd-io#4363; bad requests didn't return an error.
185bc34
to
c5c5063
Compare
etcdserver: reject v3 txns with duplicate put keys
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>
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>
An API check to support PR #4363; bad requests didn't return an error.