{"action":"created","issue":{"url":"https://api.github.com/repos/garyburd/redigo/issues/120","labels_url":"https://api.github.com/repos/garyburd/redigo/issues/120/labels{/name}","comments_url":"https://api.github.com/repos/garyburd/redigo/issues/120/comments","events_url":"https://api.github.com/repos/garyburd/redigo/issues/120/events","html_url":"https://github.com/garyburd/redigo/pull/120","id":67704663,"number":120,"title":"Support for redis sentinel","user":{"login":"hbcheng","id":3744766,"avatar_url":"https://avatars.githubusercontent.com/u/3744766?v=3","gravatar_id":"","url":"https://api.github.com/users/hbcheng","html_url":"https://github.com/hbcheng","followers_url":"https://api.github.com/users/hbcheng/followers","following_url":"https://api.github.com/users/hbcheng/following{/other_user}","gists_url":"https://api.github.com/users/hbcheng/gists{/gist_id}","starred_url":"https://api.github.com/users/hbcheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hbcheng/subscriptions","organizations_url":"https://api.github.com/users/hbcheng/orgs","repos_url":"https://api.github.com/users/hbcheng/repos","events_url":"https://api.github.com/users/hbcheng/events{/privacy}","received_events_url":"https://api.github.com/users/hbcheng/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"garyburd","id":33411,"avatar_url":"https://avatars.githubusercontent.com/u/33411?v=3","gravatar_id":"","url":"https://api.github.com/users/garyburd","html_url":"https://github.com/garyburd","followers_url":"https://api.github.com/users/garyburd/followers","following_url":"https://api.github.com/users/garyburd/following{/other_user}","gists_url":"https://api.github.com/users/garyburd/gists{/gist_id}","starred_url":"https://api.github.com/users/garyburd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garyburd/subscriptions","organizations_url":"https://api.github.com/users/garyburd/orgs","repos_url":"https://api.github.com/users/garyburd/repos","events_url":"https://api.github.com/users/garyburd/events{/privacy}","received_events_url":"https://api.github.com/users/garyburd/received_events","type":"User","site_admin":false},"milestone":null,"comments":17,"created_at":"2015-04-10T23:41:08Z","updated_at":"2015-08-19T13:19:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/garyburd/redigo/pulls/120","html_url":"https://github.com/garyburd/redigo/pull/120","diff_url":"https://github.com/garyburd/redigo/pull/120.diff","patch_url":"https://github.com/garyburd/redigo/pull/120.patch"},"body":"Briefly, the SentinelClient supplied by sentinel.go represents a connection to a bundle of sentinels. While only one connection is active at a time, the SentinelClient will failover its internal connection to all configured sentinels before failing any individual operation.\r\n\r\nThe SentinelClient has a Dial method, which connects to the sentinel, and DialMaster and DialSlave methods, which connect to the named master or slaves of the named master, respectively.\r\n\r\nThe SentinelAwarePool supplied in pool.go is extremely simple. I wanted to avoid an overly-complex implementation here, because I don't have a lot of operational experience with the Pool. The only differences are the addition of a TestOnReturn entry point, which is designed to test returned connections for role changes, and a method to update the internal accounting of the master's address. (Role detection and test wrappers are supplied in sentinel.go). The only meaningful operational difference to the SentinelAwarePool is the ability to purge all idle connections if the master's configuration changes. (active connections will be handled by TestOnReturn).\r\n\r\nAn example of usage of the SentinelAwarePool is supplied in pool.go.\r\n\r\nI believe I have supplied sufficient capability here for a barebones but fully capable sentinel configuration, and enough tools and flexibility for a user to build a more complex setup (including using Sentinel pubsub, which is not included here.)\r\n\r\nI've tested this (both pool and standalone connections) on a new 2.8 cluster and an older 2.6-era cluster which does not have CLIENT kill. I would appreciate additional testing and validation if possible, especially on the new 3.0 cluster which I do not have access to."},"comment":{"url":"https://api.github.com/repos/garyburd/redigo/issues/comments/132591522","html_url":"https://github.com/garyburd/redigo/pull/120#issuecomment-132591522","issue_url":"https://api.github.com/repos/garyburd/redigo/issues/120","id":132591522,"user":{"login":"rafaeljusto","id":611469,"avatar_url":"https://avatars.githubusercontent.com/u/611469?v=3","gravatar_id":"","url":"https://api.github.com/users/rafaeljusto","html_url":"https://github.com/rafaeljusto","followers_url":"https://api.github.com/users/rafaeljusto/followers","following_url":"https://api.github.com/users/rafaeljusto/following{/other_user}","gists_url":"https://api.github.com/users/rafaeljusto/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaeljusto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaeljusto/subscriptions","organizations_url":"https://api.github.com/users/rafaeljusto/orgs","repos_url":"https://api.github.com/users/rafaeljusto/repos","events_url":"https://api.github.com/users/rafaeljusto/events{/privacy}","received_events_url":"https://api.github.com/users/rafaeljusto/received_events","type":"User","site_admin":false},"created_at":"2015-08-19T13:19:36Z","updated_at":"2015-08-19T13:19:36Z","body":"+1 =)"}}