{"action":"created","issue":{"url":"https://api.github.com/repos/luin/ioredis/issues/201","labels_url":"https://api.github.com/repos/luin/ioredis/issues/201/labels{/name}","comments_url":"https://api.github.com/repos/luin/ioredis/issues/201/comments","events_url":"https://api.github.com/repos/luin/ioredis/issues/201/events","html_url":"https://github.com/luin/ioredis/issues/201","id":119283617,"number":201,"title":"Few questions regarding library flow in different situtations","user":{"login":"shaharmor","id":10861920,"avatar_url":"https://avatars.githubusercontent.com/u/10861920?v=3","gravatar_id":"","url":"https://api.github.com/users/shaharmor","html_url":"https://github.com/shaharmor","followers_url":"https://api.github.com/users/shaharmor/followers","following_url":"https://api.github.com/users/shaharmor/following{/other_user}","gists_url":"https://api.github.com/users/shaharmor/gists{/gist_id}","starred_url":"https://api.github.com/users/shaharmor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaharmor/subscriptions","organizations_url":"https://api.github.com/users/shaharmor/orgs","repos_url":"https://api.github.com/users/shaharmor/repos","events_url":"https://api.github.com/users/shaharmor/events{/privacy}","received_events_url":"https://api.github.com/users/shaharmor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-28T09:59:08Z","updated_at":"2015-11-28T15:10:52Z","closed_at":null,"body":"Hi,\r\n\r\nI would like to know how the library performs under certain situations if possible: \r\nConsidering a Redis cluster with a master & a slave responsible for X slots.\r\n  - How does the library gets notified when a master goes down?\r\n    - Does it wait for an incoming error?\r\n    - Does it run a periodic cluster slots check?\r\n    - What about requests that were already sent to the dead master?\r\n  - Given that the library knows a master has failed, what will happened until the slave takes over?\r\n    - Will the requests be queued? failed? retried? \r\n  - In a situation that the slave fails to take over and there are slots not allocated, what happens to requests targeted for those slots?\r\n    - Are they queued until the slots will be allocated? If so, can we limit the queue?\r\n    - What happens if the master never comes back? Will the library just get filled with callbacks waiting for it to come back?\r\n\r\nI have more questions but i think we should start a conversation about these first and go from there.\r\n\r\nThanks a lot for the help in advance.\r\n"},"comment":{"url":"https://api.github.com/repos/luin/ioredis/issues/comments/160309522","html_url":"https://github.com/luin/ioredis/issues/201#issuecomment-160309522","issue_url":"https://api.github.com/repos/luin/ioredis/issues/201","id":160309522,"user":{"login":"luin","id":635902,"avatar_url":"https://avatars.githubusercontent.com/u/635902?v=3","gravatar_id":"","url":"https://api.github.com/users/luin","html_url":"https://github.com/luin","followers_url":"https://api.github.com/users/luin/followers","following_url":"https://api.github.com/users/luin/following{/other_user}","gists_url":"https://api.github.com/users/luin/gists{/gist_id}","starred_url":"https://api.github.com/users/luin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luin/subscriptions","organizations_url":"https://api.github.com/users/luin/orgs","repos_url":"https://api.github.com/users/luin/repos","events_url":"https://api.github.com/users/luin/events{/privacy}","received_events_url":"https://api.github.com/users/luin/received_events","type":"User","site_admin":false},"created_at":"2015-11-28T15:10:52Z","updated_at":"2015-11-28T15:10:52Z","body":"> How does the library gets notified when a master goes down?\r\n\r\nioredis considers a node is down when receiving a TCP `end` event. What's more, if ioredis receives an specified error (e.g. `CLUSTERDOWN`) when sending a command, it will know the cluster is down.\r\n\r\n> What about requests that were already sent to the dead master?\r\n\r\nioredis will retry them when cluster is online again. There are [several options](https://github.com/luin/ioredis#cluster) to adjust this behaviour.\r\n\r\n> Given that the library knows a master has failed, what will happened until the slave takes over?\r\nWill the requests be queued? failed? retried?\r\n\r\nAgain, this requests are queued and will be retried when the new master is online.\r\n\r\n> In a situation that the slave fails to take over and there are slots not allocated, what happens to requests targeted for those slots?\r\n\r\n> What happens if the master never comes back? Will the library just get filled with callbacks waiting for it to come back?\r\n\r\nSee `retryDelayOnClusterDown` option.\r\n"}}