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

etcdctl/ctlv3: clarify "lease timetolive" output on expired lease #9052

Merged
merged 3 commits into from
Dec 20, 2017

Conversation

gyuho
Copy link
Contributor

@gyuho gyuho commented Dec 20, 2017

Fix #9028.

@hexfusion Could you review? Had to finish this early, to ship this in today's rc release.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
@hexfusion
Copy link
Contributor

hexfusion commented Dec 20, 2017

@gyuho, yes will review this morning.

@hexfusion
Copy link
Contributor

hexfusion commented Dec 20, 2017

@gyuho, code LGTM, just need to restart semaphoreci and jenkins tests. They did pass locally. Few things:

./etcdctl lease grant 500
# lease 2d8257079fa1bc0c granted with TTL(500s)

./etcdctl put foo1 bar --lease=2d8257079fa1bc0c
# OK

./etcdctl put foo2 bar --lease=2d8257079fa1bc0c
# OK

./etcdctl lease timetolive 2d8257079fa1bc0c
# lease 2d8257079fa1bc0c granted with TTL(500s), remaining(481s)

./etcdctl lease timetolive 2d8257079fa1bc0c --keys
# lease 2d8257079fa1bc0c granted with TTL(500s), remaining(472s), attached keys([foo2 foo1])

./etcdctl lease timetolive 2d8257079fa1bc0c --write-out=json
# {"cluster_id":17186838941855831277,"member_id":4845372305070271874,"revision":3,"raft_term":2,"id":3279279168933706764,"ttl":465,"granted-ttl":500,"keys":null}

./etcdctl lease timetolive 2d8257079fa1bc0c --write-out=json --keys
# {"cluster_id":17186838941855831277,"member_id":4845372305070271874,"revision":3,"raft_term":2,"id":3279279168933706764,"ttl":459,"granted-ttl":500,"keys":["Zm9vMQ==","Zm9vMg=="]}

./etcdctl lease timetolive 2d8257079fa1bc0c
# lease 2d8257079fa1bc0c already expired 

Thanks!

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
@codecov-io
Copy link

Codecov Report

Merging #9052 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9052      +/-   ##
==========================================
- Coverage   76.09%   76.07%   -0.03%     
==========================================
  Files         359      359              
  Lines       29841    29844       +3     
==========================================
- Hits        22707    22703       -4     
- Misses       5556     5567      +11     
+ Partials     1578     1574       -4
Impacted Files Coverage Δ
etcdctl/ctlv3/command/printer_simple.go 70.62% <100%> (+0.62%) ⬆️
pkg/fileutil/purge.go 73.68% <0%> (-7.9%) ⬇️
etcdctl/ctlv3/command/lease_command.go 65.34% <0%> (-5.95%) ⬇️
mvcc/watchable_store.go 85.97% <0%> (-4.06%) ⬇️
clientv3/leasing/cache.go 87.77% <0%> (-3.34%) ⬇️
etcdserver/api/v3rpc/watch.go 88.58% <0%> (-3.2%) ⬇️
clientv3/concurrency/election.go 79.52% <0%> (-2.37%) ⬇️
raft/node.go 89.38% <0%> (-2.22%) ⬇️
rafthttp/msgappv2_codec.go 69.56% <0%> (-1.74%) ⬇️
clientv3/leasing/kv.go 89.93% <0%> (-1.01%) ⬇️
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 828289d...f59808a. Read the comment docs.

@gyuho gyuho merged commit e378b98 into etcd-io:master Dec 20, 2017
@gyuho gyuho deleted the lease-timetolive-output branch December 20, 2017 17:49
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