-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix timeout when defragmenting etcd on startup #11164
Conversation
@@ -1593,24 +1598,6 @@ func (e *ETCD) GetMembersClientURLs(ctx context.Context) ([]string, error) { | |||
return clientURLs, nil | |||
} | |||
|
|||
// GetMembersNames will list through the member lists in etcd and return | |||
// back a combined list of member names | |||
func (e *ETCD) GetMembersNames(ctx context.Context) ([]string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function was not used here or in rke2 and is not required by the interface.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #11164 +/- ##
===========================================
- Coverage 48.72% 38.10% -10.63%
===========================================
Files 178 162 -16
Lines 14813 17979 +3166
===========================================
- Hits 7218 6850 -368
- Misses 6288 9932 +3644
+ Partials 1307 1197 -110
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Shouldn't we add a (larger) timeout for defrag? Could etcd get stuck in defrag forever for some reason? |
The reason we added a timeout on the status command is that the etcd grpc client will retry it automatically if the connection to the service is unavailable. I don't believe the other commands are subject to retry, but I'm going to add some tests to this to verify behavior before merging. |
796d8a9
to
a3d1693
Compare
a3d1693
to
cae9e2b
Compare
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
cae9e2b
to
521d515
Compare
521d515
to
5e6dc72
Compare
Confirmed no breakage here: NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
k3s-server-1 Ready control-plane,etcd,master 2m33s v1.31.1+k3s-5e6dc725 172.17.0.4 <none> K3s v1.31.1-k3s-5e6dc725 6.8.0-1016-aws containerd://1.7.22-k3s1
k3s-server-2 Ready etcd 80s v1.31.1+k3s-5e6dc725 172.17.0.5 <none> K3s v1.31.1-k3s-5e6dc725 6.8.0-1016-aws containerd://1.7.22-k3s1
k3s-server-3 Ready control-plane,etcd,master 58s v1.31.1+k3s-5e6dc725 172.17.0.6 <none> K3s v1.31.1-k3s-5e6dc725 6.8.0-1016-aws containerd://1.7.22-k3s1
k3s-server-4 Ready control-plane,master 33s v1.31.1+k3s-5e6dc725 172.17.0.7 <none> K3s v1.31.1-k3s-5e6dc725 6.8.0-1016-aws containerd://1.7.22-k3s1 Confirmed no breakage on the RKE2 side with these changes: rancher/rke2#7139 And the startup actually seems to be a bit faster, with less log spam while etcd is starting. |
5e6dc72
to
eede569
Compare
eede569
to
72eb27f
Compare
* Use clientv3.NewCtxClient instead of New to avoid automatic retry of all RPCs * Only timeout status requests; allow defrag and alarm clear requests to run to completion. * Only clear alarms on the local cluster member, not ALL cluster members Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
72eb27f
to
09cea43
Compare
wantErr: false, | ||
}, | ||
{ | ||
name: "slow defrag", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
Proposed Changes
Fix timeout when defragmenting etcd on startup:
Types of Changes
bugfix / enhancement
Verification
Testing
new tests added
Linked Issues
User-Facing Change
Further Comments