fix_the_etcdv2_1000ErrorCodeEventIndexCleared_bug#1141
Open
liucimin wants to merge 1 commit intocontiv:masterfrom
Open
fix_the_etcdv2_1000ErrorCodeEventIndexCleared_bug#1141liucimin wants to merge 1 commit intocontiv:masterfrom
liucimin wants to merge 1 commit intocontiv:masterfrom
Conversation
Author
unclejack
reviewed
Jun 4, 2018
| switch err.(type) { | ||
| case *client.ClusterError: | ||
| // retry and wait for etcd cluster to recover! | ||
| time.Sleep(time.Second * 5) |
Contributor
There was a problem hiding this comment.
How did you choose this value for the sleep?
Author
There was a problem hiding this comment.
The value for the sleep can be set any value.But this decides how many times the watcher will send request to the etcd until the cluster being recover.
The etcd cluster may be recovered any time after it broken.So i choose the value from my experiences.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the changes
Type of fix: Bug Fix
Fixes #1140
Please describe:
Add the protection for the watcher.
When the watcher get the ErrorCodeEventIndexCleared from the etcd,we should create a new watcher
to catch Future events。
manual test in my env.
TODO
1.Create a new network for the contiv.
Result : make sure the pod can be create by the netplugin.
2.Use the contiv until the etcd index 1000 larger than step 1.
Result : use the curl to get the etcd's index.
3.Interrupt the network between netplugin and etcd.
Result: can see "Error client:etcd cluster is unavailable or misconfigured during watch" in the netplugin log.
4.Resume the etwork between netplugin and etcd.
Result: can see "Error 401: The event in requested index is outdated and cleared (*) during watch" in the netplugin log.
5.Create a new network for the contiv.
Result: create succeed.
6.Create new pods.
Result : make sure the pod can be create by the new network.