etcd v3 key attached on an expired lease.

542 views
Skip to first unread message

Aditya Dani

unread,
Jul 6, 2017, 11:15:21 AM7/6/17
to etcd-dev
Hello,

I have a 3 node etcd cluster in which I am creating a key which is attached with a lease.

On one of the nodes I see the following

# etcdctl --endpoints=[127.0.0.1:2379]--write-out="fields" get <key>
"ClusterID" : 7883545499860909880
"MemberID" : 4450878479066924184
"Revision" : 25346
"RaftTerm" : 11
"Key" : "<key>"
"CreateRevision" : 20001
"ModRevision" : 20001
"Version" : 1
"Value" : "<value>"
"Lease" : 331116914086947474
"More" : false
"Count" : 1


However the lease associated with this key has expired

# etcdctl lease timetolive 4985D143B46AA92
lease 04985d143b46aa92 granted with TTL(0s), remaining(-1s)

Shouldn't this key have been deleted?

However if I set the endpoints to a list of 3 etcd nodes, etcdctl returns the correct output.

#  etcdctl --endpoints=[<list of ips>] --write-out="fields" get <key>
"ClusterID" : 7883545499860909880
"MemberID" : 4450878479066924184
"RaftTerm" : 11
"More" : false
"Count" : 0


Why do I see such a discrepancy in the outputs? One thing to note here is that the node which shows incorrect data rebooted when this lease was alive.


Gyu-Ho Lee

unread,
Jul 6, 2017, 12:34:46 PM7/6/17
to Aditya Dani, etcd-dev
When etcd server reboots, it refreshes TTLs on the leases.
On lease expiration, lease gets deleted.

"Count" : 0 means the key got deleted, which is expected.

--
You received this message because you are subscribed to the Google Groups "etcd-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to etcd-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Sincerely,
Gyu-Ho Lee

Aditya Dani

unread,
Jul 6, 2017, 12:46:06 PM7/6/17
to etcd-dev
If you look closely, on one of the etcd nodes this key did not get deleted, where the Count is 1.
From the 2 commands I posted, the 1st one has endpoints set to only one node where the count is still 1, but in the 2nd command output, I had set the endpoint to all the 3 nodes and then I got the count as  0. I am wondering why do we see this inconsistency on that one node.

Gyu-Ho Lee

unread,
Jul 6, 2017, 12:54:01 PM7/6/17
to Aditya Dani, etcd-dev
It shouldn't happen, and I cannot reproduce with current etcd master branch.
Could you share the reproducible steps here https://github.com/coreos/etcd/issues?
Thanks.

--
You received this message because you are subscribed to the Google Groups "etcd-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to etcd-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Sincerely,
Gyu-Ho Lee
Reply all
Reply to author
Forward
0 new messages