fix_the_etcdv2_1000ErrorCodeEventIndexCleared_bug #1141
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.