-
Notifications
You must be signed in to change notification settings - Fork 40.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kubeadm: Reduce the backoff time of AddMember for etcd
This change optimizes the kubeadm/etcd `AddMember` client-side function by stopping early in the backoff loop when a peer conflict is found (indicating the member has already been added to the etcd cluster). In this situation, the function will stop early and relay a call to `ListMembers` to fetch the current list of members to return. With this optimization, front-loading a `ListMembers` call is no longer necessary, as this functionally returns the equivalent response. This helps reduce the amount of time taken in situational cases where an initial client request to add a member is accepted by the server, but fails client-side. This situation is possible situationally, such as if network latency causes the request to timeout after it was sent and accepted by the cluster. In this situation, the following loop would occur and fail with an `ErrPeerURLExist` response, and would be stuck until the backoff timeout was met (roughly ~2min30sec currently). Testing Done: * Manual testing with an etcd cluster. Initial "AddMember` call was successful, and the etcd manifest file was identical to prior version of these files. Subsequent calls to add the same member succeeded immediately (retaining idempotency), and the resulting manifest file remains identical to previous version as well. The difference, this time, is the call finished ~2min25sec faster in an identical test in the environment tested with.
- Loading branch information
Showing
4 changed files
with
34 additions
and
34 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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