Skip to content
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

etcdserver: use context for Renew #6929

Merged
merged 3 commits into from
Dec 7, 2016

Conversation

heyitsanthony
Copy link
Contributor

Renew would retry a few times before returning a not primary error that
the client should never see. Instead, use proper timeouts and
then return a request timeout error on failure.

Fixes #6922

@heyitsanthony heyitsanthony force-pushed the ctx-lease-renew branch 3 times, most recently from 1928a61 to 2c3ba79 Compare December 5, 2016 17:46
@gyuho
Copy link
Contributor

gyuho commented Dec 5, 2016

lgtm. Defer to @xiang90

<-ka

// force keepalive stream message to timeout
clus.Members[1].Stop(t)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how do we ensure member[0] is not the leader?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quorum loss

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leader will stepdown after X seconds I believe, not immediately.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, but for the duration it's not going to be able to expire any keys. The test just needs to get a renew failure + lease extension. Maybe this test should be renamed TestLeaseRenewLostQuorum?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

if err != nil {
return -1, err
}
req = req.WithContext(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does go16 support this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugh 3.0 backporting, I'll fix this to do it without it

Anthony Romano added 3 commits December 6, 2016 14:09
Giving Renew() the default request timeout causes TestV3LeaseFailover
to miss its timing constraints. Since it only needs to wait until the
leader recognizes the leader is lost, use RequireLeader to cancel the
keepalive stream before the request times out.
Would retry a few times before returning a not primary error that
the client should never see. Instead, use proper timeouts and
then return a request timeout error on failure.

Fixes etcd-io#6922
@xiang90
Copy link
Contributor

xiang90 commented Dec 7, 2016

lgtm

@heyitsanthony heyitsanthony merged commit da3b71b into etcd-io:master Dec 7, 2016
@heyitsanthony
Copy link
Contributor Author

I assume this is to be backported if 1.6 compatibility is important

@heyitsanthony heyitsanthony deleted the ctx-lease-renew branch December 7, 2016 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants