{"action":"created","issue":{"url":"https://api.github.com/repos/otoolep/rqlite/issues/38","labels_url":"https://api.github.com/repos/otoolep/rqlite/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/otoolep/rqlite/issues/38/comments","events_url":"https://api.github.com/repos/otoolep/rqlite/issues/38/events","html_url":"https://github.com/otoolep/rqlite/issues/38","id":68125395,"number":38,"title":"Reconnecting to a leader fails from the same connection String. (IE replacing peers)","user":{"login":"tchoulihan","id":930215,"avatar_url":"https://avatars.githubusercontent.com/u/930215?v=3","gravatar_id":"","url":"https://api.github.com/users/tchoulihan","html_url":"https://github.com/tchoulihan","followers_url":"https://api.github.com/users/tchoulihan/followers","following_url":"https://api.github.com/users/tchoulihan/following{/other_user}","gists_url":"https://api.github.com/users/tchoulihan/gists{/gist_id}","starred_url":"https://api.github.com/users/tchoulihan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchoulihan/subscriptions","organizations_url":"https://api.github.com/users/tchoulihan/orgs","repos_url":"https://api.github.com/users/tchoulihan/repos","events_url":"https://api.github.com/users/tchoulihan/events{/privacy}","received_events_url":"https://api.github.com/users/tchoulihan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-04-13T15:23:38Z","updated_at":"2015-04-15T12:41:56Z","closed_at":null,"body":"One thing is making debugging really difficult.\r\n\r\nIf a peer attaches to a leader, then has an error for some reason, and I need that same peer to rejoin from a specific connectionstring(an ip address in my case), I have to completely delete the leader and the peer, to get things working again. Otherwise it will stall on `attempting to join peer`, and the old leader node still shows the old connection string and old name.\r\n\r\nI see either two solutions. I like 1) better.\r\n1) If a leader receives a join command from that connetion string, replace it correctly with the new name and connection string. This scales better too.\r\n\r\n2) It also might be useful, if you create an endpoint that can clear a specific peer, or all the peers. The code for this might have to be done to complete the first solution anyway. \r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/otoolep/rqlite/issues/comments/93373861","html_url":"https://github.com/otoolep/rqlite/issues/38#issuecomment-93373861","issue_url":"https://api.github.com/repos/otoolep/rqlite/issues/38","id":93373861,"user":{"login":"tchoulihan","id":930215,"avatar_url":"https://avatars.githubusercontent.com/u/930215?v=3","gravatar_id":"","url":"https://api.github.com/users/tchoulihan","html_url":"https://github.com/tchoulihan","followers_url":"https://api.github.com/users/tchoulihan/followers","following_url":"https://api.github.com/users/tchoulihan/following{/other_user}","gists_url":"https://api.github.com/users/tchoulihan/gists{/gist_id}","starred_url":"https://api.github.com/users/tchoulihan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchoulihan/subscriptions","organizations_url":"https://api.github.com/users/tchoulihan/orgs","repos_url":"https://api.github.com/users/tchoulihan/repos","events_url":"https://api.github.com/users/tchoulihan/events{/privacy}","received_events_url":"https://api.github.com/users/tchoulihan/received_events","type":"User","site_admin":false},"created_at":"2015-04-15T12:41:56Z","updated_at":"2015-04-15T12:41:56Z","body":"Here's a script I just worked up that replicates the error, you can test this. Be careful because it kills any running rql instance:\r\n```sh\r\n# install rqlite\r\ngo get github.com/otoolep/rqlite\r\nexport GOPATH=$PWD\r\n\r\n# Startup 2 nodes\r\n$GOPATH/bin/rqlite node_1 &\r\nsleep 2s\r\n$GOPATH/bin/rqlite -join localhost:4001 -p 4002 node_2 &\r\nsleep 2s\r\n\r\n# Now kill node 2 and clear it, assuming it has an error\r\nps aux | grep -ie node_2 | awk '{print $2}' | xargs kill -9\r\nrm -rf node_2\r\n\r\n# Now try to rejoin node 1\r\n$GOPATH/bin/rqlite -join localhost:4001 -p 4002 node_2 &\r\n\r\n# And you'll see that the error is that it stalls on attempting to join leader\r\n#. The only way to get it working again is to delete node 1 completely!\r\n\r\nsleep 5s\r\n\r\n#kills all the rqlite instances\r\nps aux | grep -ie rqlite | awk '{print $2}' | xargs kill -9\r\nrm -rf node_1 node_2\r\n```"}}