{"action":"closed","issue":{"url":"https://api.github.com/repos/sensu/sensu/issues/1891","repository_url":"https://api.github.com/repos/sensu/sensu","labels_url":"https://api.github.com/repos/sensu/sensu/issues/1891/labels{/name}","comments_url":"https://api.github.com/repos/sensu/sensu/issues/1891/comments","events_url":"https://api.github.com/repos/sensu/sensu/issues/1891/events","html_url":"https://github.com/sensu/sensu/issues/1891","id":348025240,"node_id":"MDU6SXNzdWUzNDgwMjUyNDA=","number":1891,"title":"Deleted clients' last_ok keys are being left behind in Redis","user":{"login":"RoboticCheese","id":956619,"node_id":"MDQ6VXNlcjk1NjYxOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/956619?v=4","gravatar_id":"","url":"https://api.github.com/users/RoboticCheese","html_url":"https://github.com/RoboticCheese","followers_url":"https://api.github.com/users/RoboticCheese/followers","following_url":"https://api.github.com/users/RoboticCheese/following{/other_user}","gists_url":"https://api.github.com/users/RoboticCheese/gists{/gist_id}","starred_url":"https://api.github.com/users/RoboticCheese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoboticCheese/subscriptions","organizations_url":"https://api.github.com/users/RoboticCheese/orgs","repos_url":"https://api.github.com/users/RoboticCheese/repos","events_url":"https://api.github.com/users/RoboticCheese/events{/privacy}","received_events_url":"https://api.github.com/users/RoboticCheese/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-06T18:01:18Z","updated_at":"2018-08-07T20:40:36Z","closed_at":"2018-08-07T20:40:36Z","author_association":"CONTRIBUTOR","body":"When deleting a client via the API, its `history:*:last_ok` keys are all left behind to accumulate in Redis over time.\r\n\r\n## Expected Behavior\r\n\r\nDeleting a client deletes both of the `history:*` keys for every check.\r\n\r\n## Current Behavior\r\n\r\nThe main history key (e.g. `history:i-0677e76e2276192c4:dns_processes`) is deleted but the corresponding last_ok key (e.g. `history:i-0677e76e2276192c4:dns_processes:last_ok`) is left over.\r\n\r\n## Possible Solution\r\n\r\nDelete both keys as part of client deletion.\r\n\r\n## Steps to Reproduce (for bugs)\r\n\r\n1. Delete any client via the Sensu API (e.g. `curl -X DELETE -v http://127.0.0.1:4567/clients/i-0677e76e2276192c4`).\r\n2. Check the Redis backend for the orphaned keys (e.g. `redis-cli -h redis.example.com KEYS history:i-0677e76e2276192c4*`).\r\n\r\n## Context\r\n\r\nWe had an unrelated issue with our Redis cluster the other day and, in investigating it, we noticed that the number of keys being stored was increasing over time even though our number of active EC2 instances wasn't. Turns out to be because of the keys from old instances being left behind.\r\n\r\n## Your Environment\r\n\r\n* Sensu version used: 1.4.2\r\n* Operating System and version (e.g. Ubuntu 14.04): Ubuntu 14.04\r\n* Transport and runtime versions (e.g. RabbitMQ 3.6.2 on Erlang 18.2): Redis 3.2 in AWS Elasticache"}}
{"actor":{"display_login":"RoboticCheese"}}