-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
atomic Compare-and-Swap PrevNoExist, the operation failed,but the key was stored #5832
Comments
Can you format your code? Also it would be helpful if you can provide the full code block. |
@yorkart I tried to reproduce this but no luck. What is |
@xiang90 @heyitsanthony I have edited issue and submitted the code. Run a few times, can see the above two kinds of errors |
@yorkart I still can't reproduce this bug after looping a few hundred times with that code. What do you mean by "run a few times"? Do the errors show up immediately when the program starts or does it start giving errors in the middle of a run? |
giving errors in the middle of a run in addition, cluster log frequently prompted
heartbeat config:
I guess the timeout has led to the operation of the result is not consistent, the cluster has been processed, but to return to the failure to the client |
@yorkart that wouldn't lead to loss of consistency. Are the Set/Delete requests returning time-out errors? etcd shouldn't return success unless the request is committed. Can you please provide the full server log? |
@heyitsanthony no time-out error. As the demo code , sequential execute |
@yorkart that is a very unhealthy cluster; it's doing a leader election several times a minute. I'll see if I can reproduce under similar conditions. Do you see the same behavior with 3.0? |
Old behavior would retry set and delete even if there's an error. This can lead to the client returning an error for deleting twice, instead of returning an error for an interdeterminate state. Fixes etcd-io#5832
v3 is ok . Using the same test logic, only timed out error v3 demo at this time, cluster get log
in addition, when the demo is running, cluster always print log
#5871 - I have the same problem when use v3 client |
@yorkart your etcd cluster has very high latencies which is why it's triggering leader elections. You'll need to increase the |
Old behavior would retry set and delete even if there's an error. This can lead to the client returning an error for deleting twice, instead of returning an error for an interdeterminate state. Fixes etcd-io#5832
Old behavior would retry set and delete even if there's an error. This can lead to the client returning an error for deleting twice, instead of returning an error for an interdeterminate state. Fixes #5832
etcd: v2.3.6
there is a demo https://github.com/yorkart/etcd-demo
when loop invoke atomic set and delete
after some times get error :
set key error: 105: Key already exists (/demo/a) [1533028]
delete key error: 100: Key not found (/demo/a) [1530634]
The text was updated successfully, but these errors were encountered: