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

etcd: try put again when the ch closed #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

veloting
Copy link

  1. put(key, value, opt.keepalive=true) to etcd
  2. kill etcd server
  3. wait for 30s
  4. start etcd server

problem:
5. the key will not exist in the etcd server

expect:
5. the (key, value) will put again in etcd server

@veloting
Copy link
Author

@ldez
When I was testing the keepalive option of the Put command, I found that once I restarted the etcd server, the keepalive behavior would be invalid. The most terrible thing is that I don't know when the keepalive will be invalid, so once I use the keepalive I have to start another coroutine to determine whether the Put information is still valid. Because of the lease.KeepAlive itself will return a channel, when the channel is closed, the keepalive fails. At this time, we can put it again to make the keepalive take effect. The following is the test flow

  1. call the put command (set keepalive=true)
  2. stop etcd server
  3. wait 30 seconds
  4. start etcd server

problem:
The set value does not exist on etcd

expect:
The set value still exists in etcd

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.

1 participant