{"action":"created","issue":{"url":"https://api.github.com/repos/antirez/redis/issues/2279","labels_url":"https://api.github.com/repos/antirez/redis/issues/2279/labels{/name}","comments_url":"https://api.github.com/repos/antirez/redis/issues/2279/comments","events_url":"https://api.github.com/repos/antirez/redis/issues/2279/events","html_url":"https://github.com/antirez/redis/issues/2279","id":54093898,"number":2279,"title":"Sync not working between master and slave","user":{"login":"pkandathil","id":1751772,"avatar_url":"https://avatars.githubusercontent.com/u/1751772?v=3","gravatar_id":"","url":"https://api.github.com/users/pkandathil","html_url":"https://github.com/pkandathil","followers_url":"https://api.github.com/users/pkandathil/followers","following_url":"https://api.github.com/users/pkandathil/following{/other_user}","gists_url":"https://api.github.com/users/pkandathil/gists{/gist_id}","starred_url":"https://api.github.com/users/pkandathil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkandathil/subscriptions","organizations_url":"https://api.github.com/users/pkandathil/orgs","repos_url":"https://api.github.com/users/pkandathil/repos","events_url":"https://api.github.com/users/pkandathil/events{/privacy}","received_events_url":"https://api.github.com/users/pkandathil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-12T19:12:59Z","updated_at":"2015-03-15T07:19:45Z","closed_at":null,"body":"## Output ##\r\n```\r\n[7371] 12 Jan 10:58:51.668 * Connecting to MASTER 127.0.0.1:6379\r\n[7371] 12 Jan 10:58:51.669 * MASTER <-> SLAVE sync started\r\n[7371] 12 Jan 10:58:51.669 * Non blocking connect for SYNC fired the event.\r\n[7371] 12 Jan 10:58:51.669 * Master replied to PING, replication can continue...\r\n[7371] 12 Jan 10:58:51.669 * Partial resynchronization not possible (no cached master)\r\n[7371] 12 Jan 10:58:51.669 * Master does not support PSYNC or is in error state (reply: -ERR Can't SYNC while not connected with my master)\r\n\r\n----------------------------\r\n$ ps -ef | grep redis\r\nroot      4330  3645  0 09:51 pts/27   00:00:00 sudo redis-sentinel /etc/redis/sen_26379.conf\r\nroot      4331  4330  1 09:51 pts/27   00:00:58 redis-sentinel *:26379                  \r\nroot      4334  3551  0 09:51 pts/17   00:00:00 sudo redis-sentinel /etc/redis/sen_26380.conf\r\nroot      4338  4334  0 09:51 pts/17   00:00:45 redis-sentinel *:26380                  \r\nroot      7364  3466  0 10:57 pts/1    00:00:00 sudo /etc/init.d/redis_6379 start\r\nroot      7365  7364  0 10:57 pts/1    00:00:00 /bin/sh /etc/init.d/redis_6379 start\r\nroot      7366  7365  0 10:57 pts/1    00:00:02 /usr/local/bin/redis-server *:6379              \r\nroot      7476  3526  0 11:10 pts/15   00:00:00 sudo /etc/init.d/redis_6380 start\r\nroot      7477  7476  0 11:10 pts/15   00:00:00 /bin/sh /etc/init.d/redis_6380 start\r\nroot      7478  7477  0 11:10 pts/15   00:00:00 /usr/local/bin/redis-server *:63\r\n---------------\r\n```\r\n### Sentinel logs ###\r\n```\r\n331] 12 Jan 11:03:36.527 # 127.0.0.1:26380 voted for 2df99efc6dab57a5b69e733c2021c8bcc5f60127 71\r\n[4331] 12 Jan 11:03:36.605 # +elected-leader master mymaster-2 127.0.0.1 6379\r\n[4331] 12 Jan 11:03:36.605 # +failover-state-select-slave master mymaster-2 127.0.0.1 6379\r\n[4331] 12 Jan 11:03:36.682 # -failover-abort-no-good-slave master mymaster-2 127.0.0.1 6379\r\n[4331] 12 Jan 11:03:36.739 # Next failover delay: I will not start a failover before Mon Jan 12 11:09:36 2015\r\n[4331] 12 Jan 11:09:36.744 # +new-epoch 72\r\n[4331] 12 Jan 11:09:36.745 # +vote-for-leader 0fb5299895b2f8eedbad50d770f2a1ee647ffb1f 72\r\n[4331] 12 Jan 11:09:36.788 # Next failover delay: I will not start a failover before Mon Jan 12 11:15:36 2015\r\n[4331] 12 Jan 11:09:36.953 # +new-epoch 73\r\n[4331] 12 Jan 11:09:36.955 # +vote-for-leader 0fb5299895b2f8eedbad50d770f2a1ee647ffb1f 73\r\n[4331] 12 Jan 11:09:36.996 # Next failover delay: I will not start a failover before Mon Jan 12 11:15:37 2015\r\n[4331] 12 Jan 11:09:36.996 # +new-epoch 74\r\n[4331] 12 Jan 11:09:36.996 # +try-failover master mymaster-2 127.0.0.1 6379\r\n[4331] 12 Jan 11:09:36.998 # +vote-for-leader 2df99efc6dab57a5b69e733c2021c8bcc5f60127 74\r\n[4331] 12 Jan 11:09:37.003 # 127.0.0.1:26380 voted for 2df99efc6dab57a5b69e733c2021c8bcc5f60127 74\r\n[4331] 12 Jan 11:09:37.061 # +elected-leader master mymaster-2 127.0.0.1 6379\r\n[4331] 12 Jan 11:09:37.061 # +failover-state-select-slave master mymaster-2 127.0.0.1 6379\r\n[4331] 12 Jan 11:09:37.133 # -failover-abort-no-good-slave master mymaster-2 127.0.0.1 6379\r\n[4331] 12 Jan 11:09:37.192 # Next failover delay: I will not start a failover before Mon Jan 12 11:15:37 2015\r\n[4331] 12 Jan 11:09:38.021 # +vote-for-leader 0fb5299895b2f8eedbad50d770f2a1ee647ffb1f 74\r\n[4331] 12 Jan 11:09:38.097 # Next failover delay: I will not start a failover before Mon Jan 12 11:15:38 2015\r\n[4331] 12 Jan 11:10:49.811 * +reboot master mymasteri-2 127.0.0.1 6380\r\n[4331] 12 Jan 11:10:49.811 * +reboot slave 127.0.0.1:6380 127.0.0.1 6380 @ mymaster-1 127.0.0.1 6379\r\n[4331] 12 Jan 11:10:49.811 * +reboot slave 127.0.0.1:6380 127.0.0.1 6380 @ mymaster-2 127.0.0.1 6379\r\n[4331] 12 Jan 11:10:49.869 # -sdown slave 127.0.0.1:6380 127.0.0.1 6380 @ mymaster-1 127.0.0.1 6379\r\n[4331] 12 Jan 11:10:49.869 # -sdown slave 127.0.0.1:6380 127.0.0.1 6380 @ mymaster-2 127.0.0.1 6379\r\n\r\n## Redis version. Runing on Ubuntu 14.04\"\r\nRedis server v=2.8.19 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=b58773aaf691e032\r\n```\r\n\r\n\r\n## Steps to reproduce: ##\r\nI am trying to test high availability of redis and. I am trying to capture the switchmaster event that is published by the sentinels\r\n1. Setup master-1 running on port 6379 and master-2 running on port 6380. master-2 is slave of master-1\r\n2. Setup two sentinels one runningo n port 26379 and 26380. Quorum confirgured to 2\r\n3. Have a Nodejs script subscribing to events published by sentinel running on 26379\r\n4. Turn on master-1 and master-2 on command line, *not as daemon*\r\n5. Kill of master-1. See if master-2 is selected as the new master. It usually. Then turn on master 2 and see if comes on as a slave. \r\n6. Now turn off master-2 and see if master-1 is selected as a master.  \r\n\r\nRepeat steps 4 - 6. At some point you will see replication fails. \r\n"},"comment":{"url":"https://api.github.com/repos/antirez/redis/issues/comments/80889135","html_url":"https://github.com/antirez/redis/issues/2279#issuecomment-80889135","issue_url":"https://api.github.com/repos/antirez/redis/issues/2279","id":80889135,"user":{"login":"nilesh1013","id":1391165,"avatar_url":"https://avatars.githubusercontent.com/u/1391165?v=3","gravatar_id":"","url":"https://api.github.com/users/nilesh1013","html_url":"https://github.com/nilesh1013","followers_url":"https://api.github.com/users/nilesh1013/followers","following_url":"https://api.github.com/users/nilesh1013/following{/other_user}","gists_url":"https://api.github.com/users/nilesh1013/gists{/gist_id}","starred_url":"https://api.github.com/users/nilesh1013/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilesh1013/subscriptions","organizations_url":"https://api.github.com/users/nilesh1013/orgs","repos_url":"https://api.github.com/users/nilesh1013/repos","events_url":"https://api.github.com/users/nilesh1013/events{/privacy}","received_events_url":"https://api.github.com/users/nilesh1013/received_events","type":"User","site_admin":false},"created_at":"2015-03-15T07:19:45Z","updated_at":"2015-03-15T07:19:45Z","body":"@pkandathil same issue happened to me ? Did you find out the reason why servers become slaves of each other ?"}}