-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
*: lease timetolive #6321
*: lease timetolive #6321
Conversation
int64 ID = 1; | ||
} | ||
|
||
message LeaseLookupResponse { |
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.
probably we should also response with all the keys that attached to the lease?
52bf04d
to
f20039f
Compare
e33eb9f
to
95e7079
Compare
@@ -648,6 +648,8 @@ message LeaseRevokeResponse { | |||
message LeaseKeepAliveRequest { | |||
// ID is the lease ID for the lease to keep alive. | |||
int64 ID = 1; | |||
// Probe is true, then it only retrieves lease information without renewing. |
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.
Retrieve lease information without refreshing the lease.
?
for i := range resp.Keys { | ||
ks[i] = string(resp.Keys[i]) | ||
} | ||
fmt.Printf("lease %016x granted with TTL(%ds), remaining(%ds), keys(%v)\n", resp.ID, resp.GrantedTTL, resp.TTL, ks) |
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.
keys -> attached keys
Thanks @gyuho! LGTM. Defer to @heyitsanthony |
a77df00
to
53351e2
Compare
// GrantedTTL is the initial granted time in seconds upon lease creation/renewal. | ||
int64 grantedTTL = 4; | ||
// Keys is the list of keys attached to this lease. | ||
repeated string keys = 5; |
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.
this has to be repeated bytes
since "A string must always contain UTF-8 encoded or 7-bit ASCII text." but etcd keys can be arbitrary binary strings
53351e2
to
2647034
Compare
@heyitsanthony All addressed. PTAL.
Thanks! |
@@ -60,6 +60,7 @@ for dir in ${DIRS}; do | |||
protoc --gofast_out=plugins=grpc,import_prefix=github.com/coreos/:. -I=.:"${GOGOPROTO_PATH}":"${COREOS_ROOT}":"${GRPC_GATEWAY_ROOT}/third_party/googleapis" *.proto | |||
sed -i.bak -E "s/github\.com\/coreos\/(gogoproto|github\.com|golang\.org|google\.golang\.org)/\1/g" *.pb.go | |||
sed -i.bak -E 's/github\.com\/coreos\/(errors|fmt|io)/\1/g' *.pb.go | |||
sed -i.bak -E 's/import math \"github\.com\/coreos\/math\"//g' *.pb.go |
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.
This is needed when proto file has double
field, the generated Go code inserts import math "github.com/coreos/math"
line.
2647034
to
d444668
Compare
Now |
ID LeaseID `json:"id"` | ||
|
||
// TTL is the remaining TTL in seconds for the lease. | ||
// Milliseconds will be rounded off. |
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.
TTL is the remaining TTL in seconds for the lease; the lease will expire in under TTL+1 seconds.
?
lgtm after fixing minor doc nit. Thanks! |
d444668
to
b7dc6cc
Compare
Just updated the comments. Will merge after greens. Thanks a lot! |
Fix #5868.