Repository navigation
Handle corrupted etcd members - #530
Conversation
|
Overall the production code change of this PR looks good. Please resolve the test failure and mark the PR as ready to review. cc @nwnt @silentred |
|
/test pull-etcd-operator-test-e2e |
silentred
left a comment
There was a problem hiding this comment.
Overall looks good, with only 2 minor comments.
b3c8692 to
f0d659c
Compare
| return ctrl.Result{}, err | ||
| } | ||
|
|
||
| // gofail: var corruptAlarmAfterMemberRemove struct{} |
There was a problem hiding this comment.
In e2e, for the failpoint to work, you will need to specify the failpoint name with the fail term, and then call enable/disableGoFailPoint helpers during the setup and tear down to trigger it. You can see TestScaling as an example of how to do this:
etcd-operator/test/e2e/e2e_test.go
Line 132 in 9d16e80
f0d659c to
03f9e65
Compare
|
@ArkaSaha30 I simplified the implementation below, please apply it if it makes sense to you. I also re-considered @silentred 's comment #530 (comment), ideally we might need to handle the recreating case first. For example, if one etcd member is in progress of recreating, then other member is corrupted, then we should finish the recreation first. This is a extreme case, if we really run into such case, we might need human intervene. Let's leave it as it's for now @nwnt @silentred please also take a look at the test case in case you have any comments. |
|
|
||
| logger.Info("Disarming the CORRUPT alarm") | ||
| // The removed member's raft has stopped, so its endpoint can't serve the disarm. | ||
| pods := slices.DeleteFunc(slices.Clone(s.pods), func(p *corev1.Pod) bool { return member != nil && p.Name == member.Name }) |
There was a problem hiding this comment.
After a crash between MemberRemove and the Disarm, findEtcdMemberForEtcdNodeID returns nil because the node is no longer in memberListResp, so the current Pod filter excludes nothing. The removed member's still-running Pod stays in the disarm endpoint list. With the pick_first balancer (clientv3 3.7.x goes through grpc.NewClient, which defaults to pick_first), the client sticks to the first endpoint. If the removed member was ordinal 0, the disarm fails on every retry.
EtcdMember.Status.MemberID is retained after the removal of the etcd node, so we can try to match the MemberID with alarm.MemberID.
|
@ArkaSaha30 can you squash the commits or I squash them for you when merging. |
Signed-off-by: ArkaSaha30 <arkasaha30@gmail.com>
da26ee2 to
b744687
Compare
Sure, I have squashed the commits. |
|
Merging this PR for now, if anyone has any more comments, feel free to resolve them in separate PRs. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahrtr, ArkaSaha30 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Fixes: #474
This PR will: