{"action":"created","comment":{"url":"https://api.github.com/repos/influxdb/influxdb/pulls/comments/28363698","id":28363698,"diff_hunk":"@@ -567,17 +569,19 @@ func (cmd *RunCommand) openServer(joinURLs []url.URL) *influxdb.Server {\n \tif err := s.Open(cmd.config.Data.Dir, c); err != nil {\n \t\tlog.Fatalf(\"failed to open data node: %v\", err.Error())\n \t}\n-\tlog.Printf(\"data node opened at %s\", cmd.config.Data.Dir)\n+\tlog.Printf(\"data node(%d) opened at %s\", s.ID(), cmd.config.Data.Dir)\n \n-\tdataNodeIndex := s.Index()\n-\tif dataNodeIndex == 0 {\n+\t// Give brokers time to elect a leader if entire cluster is being restarted.\n+\ttime.Sleep(1 * time.Second)\n+\n+\tif s.ID() == 0 && s.Index() == 0 {\n \t\tif len(joinURLs) > 0 {\n \t\t\tjoinServer(s, cmd.config.ClusterURL(), joinURLs)\n \t\t\treturn s\n \t\t}\n \n \t\tif err := s.Initialize(cmd.config.ClusterURL()); err != nil {\n-\t\t\tlog.Fatalf(\"server initialization error: %s\", err)\n+\t\t\tlog.Fatalf(\"server initialization error(0): %s\", err)","path":"cmd/influxd/run.go","position":42,"original_position":42,"commit_id":"c5bdb5af86ea306b8d09ac7aa4246f0e2a02b043","original_commit_id":"c5bdb5af86ea306b8d09ac7aa4246f0e2a02b043","user":{"login":"otoolep","id":536312,"avatar_url":"https://avatars.githubusercontent.com/u/536312?v=3","gravatar_id":"","url":"https://api.github.com/users/otoolep","html_url":"https://github.com/otoolep","followers_url":"https://api.github.com/users/otoolep/followers","following_url":"https://api.github.com/users/otoolep/following{/other_user}","gists_url":"https://api.github.com/users/otoolep/gists{/gist_id}","starred_url":"https://api.github.com/users/otoolep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otoolep/subscriptions","organizations_url":"https://api.github.com/users/otoolep/orgs","repos_url":"https://api.github.com/users/otoolep/repos","events_url":"https://api.github.com/users/otoolep/events{/privacy}","received_events_url":"https://api.github.com/users/otoolep/received_events","type":"User","site_admin":false},"body":"You can make better log messages than this. :-) E.g.\r\n\r\n`server initialization error (server ID 0)` ?","created_at":"2015-04-14T19:52:48Z","updated_at":"2015-04-14T19:52:48Z","html_url":"https://github.com/influxdb/influxdb/pull/2283#discussion_r28363698","pull_request_url":"https://api.github.com/repos/influxdb/influxdb/pulls/2283","_links":{"self":{"href":"https://api.github.com/repos/influxdb/influxdb/pulls/comments/28363698"},"html":{"href":"https://github.com/influxdb/influxdb/pull/2283#discussion_r28363698"},"pull_request":{"href":"https://api.github.com/repos/influxdb/influxdb/pulls/2283"}}},"pull_request":{"url":"https://api.github.com/repos/influxdb/influxdb/pulls/2283","id":33292696,"html_url":"https://github.com/influxdb/influxdb/pull/2283","diff_url":"https://github.com/influxdb/influxdb/pull/2283.diff","patch_url":"https://github.com/influxdb/influxdb/pull/2283.patch","issue_url":"https://api.github.com/repos/influxdb/influxdb/issues/2283","number":2283,"state":"open","locked":false,"title":"Fix cluster-wide restart issue.","user":{"login":"benbjohnson","id":118015,"avatar_url":"https://avatars.githubusercontent.com/u/118015?v=3","gravatar_id":"","url":"https://api.github.com/users/benbjohnson","html_url":"https://github.com/benbjohnson","followers_url":"https://api.github.com/users/benbjohnson/followers","following_url":"https://api.github.com/users/benbjohnson/following{/other_user}","gists_url":"https://api.github.com/users/benbjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/benbjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benbjohnson/subscriptions","organizations_url":"https://api.github.com/users/benbjohnson/orgs","repos_url":"https://api.github.com/users/benbjohnson/repos","events_url":"https://api.github.com/users/benbjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/benbjohnson/received_events","type":"User","site_admin":false},"body":"## Overview\r\n\r\nThis pull request fixes some error checking and adds a delay when starting to allow the brokers to elect a leader when starting in the case where the whole cluster is restarted.","created_at":"2015-04-14T19:45:38Z","updated_at":"2015-04-14T19:52:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3dff9c15060ec1ceefe51e11985f971742e50c28","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/influxdb/influxdb/pulls/2283/commits","review_comments_url":"https://api.github.com/repos/influxdb/influxdb/pulls/2283/comments","review_comment_url":"https://api.github.com/repos/influxdb/influxdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/influxdb/influxdb/issues/2283/comments","statuses_url":"https://api.github.com/repos/influxdb/influxdb/statuses/c5bdb5af86ea306b8d09ac7aa4246f0e2a02b043","head":{"label":"influxdb:join-fix","ref":"join-fix","sha":"c5bdb5af86ea306b8d09ac7aa4246f0e2a02b043","user":{"login":"influxdb","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdb","html_url":"https://github.com/influxdb","followers_url":"https://api.github.com/users/influxdb/followers","following_url":"https://api.github.com/users/influxdb/following{/other_user}","gists_url":"https://api.github.com/users/influxdb/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdb/subscriptions","organizations_url":"https://api.github.com/users/influxdb/orgs","repos_url":"https://api.github.com/users/influxdb/repos","events_url":"https://api.github.com/users/influxdb/events{/privacy}","received_events_url":"https://api.github.com/users/influxdb/received_events","type":"Organization","site_admin":false},"repo":{"id":13124802,"name":"influxdb","full_name":"influxdb/influxdb","owner":{"login":"influxdb","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdb","html_url":"https://github.com/influxdb","followers_url":"https://api.github.com/users/influxdb/followers","following_url":"https://api.github.com/users/influxdb/following{/other_user}","gists_url":"https://api.github.com/users/influxdb/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdb/subscriptions","organizations_url":"https://api.github.com/users/influxdb/orgs","repos_url":"https://api.github.com/users/influxdb/repos","events_url":"https://api.github.com/users/influxdb/events{/privacy}","received_events_url":"https://api.github.com/users/influxdb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influxdb/influxdb","description":"Scalable datastore for metrics, events, and real-time analytics","fork":false,"url":"https://api.github.com/repos/influxdb/influxdb","forks_url":"https://api.github.com/repos/influxdb/influxdb/forks","keys_url":"https://api.github.com/repos/influxdb/influxdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influxdb/influxdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influxdb/influxdb/teams","hooks_url":"https://api.github.com/repos/influxdb/influxdb/hooks","issue_events_url":"https://api.github.com/repos/influxdb/influxdb/issues/events{/number}","events_url":"https://api.github.com/repos/influxdb/influxdb/events","assignees_url":"https://api.github.com/repos/influxdb/influxdb/assignees{/user}","branches_url":"https://api.github.com/repos/influxdb/influxdb/branches{/branch}","tags_url":"https://api.github.com/repos/influxdb/influxdb/tags","blobs_url":"https://api.github.com/repos/influxdb/influxdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influxdb/influxdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influxdb/influxdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/influxdb/influxdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influxdb/influxdb/statuses/{sha}","languages_url":"https://api.github.com/repos/influxdb/influxdb/languages","stargazers_url":"https://api.github.com/repos/influxdb/influxdb/stargazers","contributors_url":"https://api.github.com/repos/influxdb/influxdb/contributors","subscribers_url":"https://api.github.com/repos/influxdb/influxdb/subscribers","subscription_url":"https://api.github.com/repos/influxdb/influxdb/subscription","commits_url":"https://api.github.com/repos/influxdb/influxdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/influxdb/influxdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/influxdb/influxdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/influxdb/influxdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/influxdb/influxdb/contents/{+path}","compare_url":"https://api.github.com/repos/influxdb/influxdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influxdb/influxdb/merges","archive_url":"https://api.github.com/repos/influxdb/influxdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influxdb/influxdb/downloads","issues_url":"https://api.github.com/repos/influxdb/influxdb/issues{/number}","pulls_url":"https://api.github.com/repos/influxdb/influxdb/pulls{/number}","milestones_url":"https://api.github.com/repos/influxdb/influxdb/milestones{/number}","notifications_url":"https://api.github.com/repos/influxdb/influxdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influxdb/influxdb/labels{/name}","releases_url":"https://api.github.com/repos/influxdb/influxdb/releases{/id}","created_at":"2013-09-26T14:31:10Z","updated_at":"2015-04-14T19:51:32Z","pushed_at":"2015-04-14T19:48:04Z","git_url":"git://github.com/influxdb/influxdb.git","ssh_url":"git@github.com:influxdb/influxdb.git","clone_url":"https://github.com/influxdb/influxdb.git","svn_url":"https://github.com/influxdb/influxdb","homepage":"http://influxdb.com","size":47738,"stargazers_count":5058,"watchers_count":5058,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":454,"mirror_url":null,"open_issues_count":365,"forks":454,"open_issues":365,"watchers":5058,"default_branch":"master"}},"base":{"label":"influxdb:master","ref":"master","sha":"19a8bd303aecb4d0764d6a2c40b47f00c120f767","user":{"login":"influxdb","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdb","html_url":"https://github.com/influxdb","followers_url":"https://api.github.com/users/influxdb/followers","following_url":"https://api.github.com/users/influxdb/following{/other_user}","gists_url":"https://api.github.com/users/influxdb/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdb/subscriptions","organizations_url":"https://api.github.com/users/influxdb/orgs","repos_url":"https://api.github.com/users/influxdb/repos","events_url":"https://api.github.com/users/influxdb/events{/privacy}","received_events_url":"https://api.github.com/users/influxdb/received_events","type":"Organization","site_admin":false},"repo":{"id":13124802,"name":"influxdb","full_name":"influxdb/influxdb","owner":{"login":"influxdb","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdb","html_url":"https://github.com/influxdb","followers_url":"https://api.github.com/users/influxdb/followers","following_url":"https://api.github.com/users/influxdb/following{/other_user}","gists_url":"https://api.github.com/users/influxdb/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdb/subscriptions","organizations_url":"https://api.github.com/users/influxdb/orgs","repos_url":"https://api.github.com/users/influxdb/repos","events_url":"https://api.github.com/users/influxdb/events{/privacy}","received_events_url":"https://api.github.com/users/influxdb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influxdb/influxdb","description":"Scalable datastore for metrics, events, and real-time analytics","fork":false,"url":"https://api.github.com/repos/influxdb/influxdb","forks_url":"https://api.github.com/repos/influxdb/influxdb/forks","keys_url":"https://api.github.com/repos/influxdb/influxdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influxdb/influxdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influxdb/influxdb/teams","hooks_url":"https://api.github.com/repos/influxdb/influxdb/hooks","issue_events_url":"https://api.github.com/repos/influxdb/influxdb/issues/events{/number}","events_url":"https://api.github.com/repos/influxdb/influxdb/events","assignees_url":"https://api.github.com/repos/influxdb/influxdb/assignees{/user}","branches_url":"https://api.github.com/repos/influxdb/influxdb/branches{/branch}","tags_url":"https://api.github.com/repos/influxdb/influxdb/tags","blobs_url":"https://api.github.com/repos/influxdb/influxdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influxdb/influxdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influxdb/influxdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/influxdb/influxdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influxdb/influxdb/statuses/{sha}","languages_url":"https://api.github.com/repos/influxdb/influxdb/languages","stargazers_url":"https://api.github.com/repos/influxdb/influxdb/stargazers","contributors_url":"https://api.github.com/repos/influxdb/influxdb/contributors","subscribers_url":"https://api.github.com/repos/influxdb/influxdb/subscribers","subscription_url":"https://api.github.com/repos/influxdb/influxdb/subscription","commits_url":"https://api.github.com/repos/influxdb/influxdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/influxdb/influxdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/influxdb/influxdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/influxdb/influxdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/influxdb/influxdb/contents/{+path}","compare_url":"https://api.github.com/repos/influxdb/influxdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influxdb/influxdb/merges","archive_url":"https://api.github.com/repos/influxdb/influxdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influxdb/influxdb/downloads","issues_url":"https://api.github.com/repos/influxdb/influxdb/issues{/number}","pulls_url":"https://api.github.com/repos/influxdb/influxdb/pulls{/number}","milestones_url":"https://api.github.com/repos/influxdb/influxdb/milestones{/number}","notifications_url":"https://api.github.com/repos/influxdb/influxdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influxdb/influxdb/labels{/name}","releases_url":"https://api.github.com/repos/influxdb/influxdb/releases{/id}","created_at":"2013-09-26T14:31:10Z","updated_at":"2015-04-14T19:51:32Z","pushed_at":"2015-04-14T19:48:04Z","git_url":"git://github.com/influxdb/influxdb.git","ssh_url":"git@github.com:influxdb/influxdb.git","clone_url":"https://github.com/influxdb/influxdb.git","svn_url":"https://github.com/influxdb/influxdb","homepage":"http://influxdb.com","size":47738,"stargazers_count":5058,"watchers_count":5058,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":454,"mirror_url":null,"open_issues_count":365,"forks":454,"open_issues":365,"watchers":5058,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/influxdb/influxdb/pulls/2283"},"html":{"href":"https://github.com/influxdb/influxdb/pull/2283"},"issue":{"href":"https://api.github.com/repos/influxdb/influxdb/issues/2283"},"comments":{"href":"https://api.github.com/repos/influxdb/influxdb/issues/2283/comments"},"review_comments":{"href":"https://api.github.com/repos/influxdb/influxdb/pulls/2283/comments"},"review_comment":{"href":"https://api.github.com/repos/influxdb/influxdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/influxdb/influxdb/pulls/2283/commits"},"statuses":{"href":"https://api.github.com/repos/influxdb/influxdb/statuses/c5bdb5af86ea306b8d09ac7aa4246f0e2a02b043"}}}}