{"action":"created","issue":{"url":"https://api.github.com/repos/coreos/etcd/issues/5276","repository_url":"https://api.github.com/repos/coreos/etcd","labels_url":"https://api.github.com/repos/coreos/etcd/issues/5276/labels{/name}","comments_url":"https://api.github.com/repos/coreos/etcd/issues/5276/comments","events_url":"https://api.github.com/repos/coreos/etcd/issues/5276/events","html_url":"https://github.com/coreos/etcd/issues/5276","id":153144720,"number":5276,"title":"Watch with index (waitIndex) does not work","user":{"login":"gradywang","id":16286789,"avatar_url":"https://avatars.githubusercontent.com/u/16286789?v=3","gravatar_id":"","url":"https://api.github.com/users/gradywang","html_url":"https://github.com/gradywang","followers_url":"https://api.github.com/users/gradywang/followers","following_url":"https://api.github.com/users/gradywang/following{/other_user}","gists_url":"https://api.github.com/users/gradywang/gists{/gist_id}","starred_url":"https://api.github.com/users/gradywang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gradywang/subscriptions","organizations_url":"https://api.github.com/users/gradywang/orgs","repos_url":"https://api.github.com/users/gradywang/repos","events_url":"https://api.github.com/users/gradywang/events{/privacy}","received_events_url":"https://api.github.com/users/gradywang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-05T00:20:37Z","updated_at":"2016-05-05T00:31:25Z","closed_at":null,"body":"Hi guys,\r\n\r\nI deployed the etcd cluster with 3 nodes under docker, append my cluster information as below:\r\n```\r\n# curl -L http://9.111.255.50:2379/version | python -m json.tool\r\n{\r\n    \"etcdcluster\": \"2.3.0\",\r\n    \"etcdserver\": \"2.3.2\"\r\n}\r\n\r\n# etcdctl -C http://9.111.254.41:2379,http://9.111.255.10:2379,http://9.111.255.50:2379 member list\r\n4a2c4ac424ea87c2: name=etcd1 peerURLs=http://9.111.254.41:2380 clientURLs=http://9.111.254.41:2379,http://9.111.254.41:4001 isLeader=false\r\n9f564d76c2326b1a: name=etcd0 peerURLs=http://9.111.255.10:2380 clientURLs=http://9.111.255.10:2379,http://9.111.255.10:4001 isLeader=true\r\nf45d70d240a351bc: name=etcd2 peerURLs=http://9.111.255.50:2380 clientURLs=http://9.111.255.50:2379,http://9.111.255.50:4001 isLeader=false\r\n\r\n# etcdctl -C http://9.111.254.41:2379,http://9.111.255.10:2379,http://9.111.255.50:2379 cluster-health\r\nmember 4a2c4ac424ea87c2 is healthy: got healthy result from http://9.111.254.41:2379\r\nmember 9f564d76c2326b1a is healthy: got healthy result from http://9.111.255.10:2379\r\nmember f45d70d240a351bc is healthy: got healthy result from http://9.111.255.50:2379\r\n```\r\n\r\nI want to watch a key to get its modification in the past, but I found it does not work, my test steps as below:\r\n\r\nStep1: Put the key-value pair which I will watch:\r\n```\r\n# curl http://9.111.255.50:2379/v2/keys/key -XPUT -d value=\"Hello world\" | python -m json.tool\r\n{\r\n    \"action\": \"set\",\r\n    \"node\": {\r\n        \"createdIndex\": 99,\r\n        \"key\": \"/key\",\r\n        \"modifiedIndex\": 99,\r\n        \"value\": \"Hello world\"\r\n    }\r\n}\r\n```\r\n\r\nStep2: Watch it one terminal:\r\n```\r\n# curl  http://9.111.255.50:2379/v2/keys/key?wait=true   // It work well, after doing step3, it returned.\r\n{\"action\":\"update\",\"node\":{\"key\":\"/key\",\"value\":\"Hello world\",\"modifiedIndex\":100,\"createdIndex\":99},\"prevNode\":{\"key\":\"/key\",\"value\":\"Hello world\",\"modifiedIndex\":99,\"createdIndex\":99}}\r\n```\r\n\r\nStep3: Update this key in another terminal:\r\n```\r\n# curl http://9.111.255.50:2379/v2/keys/key -XPUT -d value=\"Hello world\" -d prevExist=true | python -m json.tool\r\n{\r\n    \"action\": \"update\",\r\n    \"node\": {\r\n        \"createdIndex\": 99,\r\n        \"key\": \"/key\",\r\n        \"modifiedIndex\": 100,\r\n        \"value\": \"Hello world\"\r\n    },\r\n    \"prevNode\": {\r\n        \"createdIndex\": 99,\r\n        \"key\": \"/key\",\r\n        \"modifiedIndex\": 99,\r\n        \"value\": \"Hello world\"\r\n    }\r\n}\r\n```\r\n\r\nStep4: Update this key again:\r\n```\r\ncurl http://9.111.255.50:2379/v2/keys/key -XPUT -d value=\"Hello world\" -d prevExist=true | python -m json.tool\r\n{\r\n    \"action\": \"update\",\r\n    \"node\": {\r\n        \"createdIndex\": 99,\r\n        \"key\": \"/key\",\r\n        \"modifiedIndex\": 101,\r\n        \"value\": \"Hello world\"\r\n    },\r\n    \"prevNode\": {\r\n        \"createdIndex\": 99,\r\n        \"key\": \"/key\",\r\n        \"modifiedIndex\": 100,\r\n        \"value\": \"Hello world\"\r\n    }\r\n}\r\n```\r\n\r\nStep5: Watch this key to get the modification with index 101:\r\n```\r\n# curl 'http://9.111.255.50:2379/v2/keys/key?wait=true&waitIndex=101'\r\ncurl: (52) Empty reply from server\r\n```\r\n\r\nI think the watched value of step5 should be:\r\n```\r\n{\r\n    \"action\": \"update\",\r\n    \"node\": {\r\n        \"createdIndex\": 99,\r\n        \"key\": \"/key\",\r\n        \"modifiedIndex\": 101,\r\n        \"value\": \"Hello world\"\r\n    },\r\n    \"prevNode\": {\r\n        \"createdIndex\": 99,\r\n        \"key\": \"/key\",\r\n        \"modifiedIndex\": 100,\r\n        \"value\": \"Hello world\"\r\n    }\r\n}\r\n```\r\nBut it returned an empty reply. Can some one help me on this issue? Maybe I was wrong in somewhere.\r\n"},"comment":{"url":"https://api.github.com/repos/coreos/etcd/issues/comments/217047071","html_url":"https://github.com/coreos/etcd/issues/5276#issuecomment-217047071","issue_url":"https://api.github.com/repos/coreos/etcd/issues/5276","id":217047071,"user":{"login":"gradywang","id":16286789,"avatar_url":"https://avatars.githubusercontent.com/u/16286789?v=3","gravatar_id":"","url":"https://api.github.com/users/gradywang","html_url":"https://github.com/gradywang","followers_url":"https://api.github.com/users/gradywang/followers","following_url":"https://api.github.com/users/gradywang/following{/other_user}","gists_url":"https://api.github.com/users/gradywang/gists{/gist_id}","starred_url":"https://api.github.com/users/gradywang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gradywang/subscriptions","organizations_url":"https://api.github.com/users/gradywang/orgs","repos_url":"https://api.github.com/users/gradywang/repos","events_url":"https://api.github.com/users/gradywang/events{/privacy}","received_events_url":"https://api.github.com/users/gradywang/received_events","type":"User","site_admin":false},"created_at":"2016-05-05T00:31:25Z","updated_at":"2016-05-05T00:31:25Z","body":"May be this is a bug for this version, I have tried with another version:\r\n```\r\n# curl -L http://9.111.255.50:2379/version | python -m json.tool\r\n{\r\n    \"etcdcluster\": \"2.2.0\",\r\n    \"etcdserver\": \"2.2.5\"\r\n}\r\n```\r\n\r\nWatch with index (waitIndex) works well."}}