{"action":"created","comment":{"url":"https://api.github.com/repos/cortexproject/cortex/pulls/comments/232336461","pull_request_review_id":173518325,"id":232336461,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMjMzNjQ2MQ==","diff_hunk":"@@ -117,15 +117,17 @@ func (d *Desc) FindIngestersByState(state IngesterState) []IngesterDesc {\n \n // Ready is true when all ingesters are active and healthy.\n func (d *Desc) Ready(heartbeatTimeout time.Duration) bool {\n+\tnumTokens := len(d.Tokens)\n \tfor _, ingester := range d.Ingesters {\n \t\tif time.Now().Sub(time.Unix(ingester.Timestamp, 0)) > heartbeatTimeout {\n \t\t\treturn false\n \t\t} else if ingester.State != ACTIVE {\n \t\t\treturn false\n \t\t}\n+\t\tnumTokens += len(ingester.Tokens)\n \t}\n \n-\treturn len(d.Tokens) > 0\n+\treturn numTokens > 0","path":"pkg/ring/model.go","position":131,"original_position":15,"commit_id":"7fc521a5ab2b378b8c3e000efd23bfbf534b141a","original_commit_id":"61a5ac689608cf0b8cf24225b55685d90d1a8a8a","user":{"login":"tomwilkie","id":444037,"node_id":"MDQ6VXNlcjQ0NDAzNw==","avatar_url":"https://avatars1.githubusercontent.com/u/444037?v=4","gravatar_id":"","url":"https://api.github.com/users/tomwilkie","html_url":"https://github.com/tomwilkie","followers_url":"https://api.github.com/users/tomwilkie/followers","following_url":"https://api.github.com/users/tomwilkie/following{/other_user}","gists_url":"https://api.github.com/users/tomwilkie/gists{/gist_id}","starred_url":"https://api.github.com/users/tomwilkie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomwilkie/subscriptions","organizations_url":"https://api.github.com/users/tomwilkie/orgs","repos_url":"https://api.github.com/users/tomwilkie/repos","events_url":"https://api.github.com/users/tomwilkie/events{/privacy}","received_events_url":"https://api.github.com/users/tomwilkie/received_events","type":"User","site_admin":false},"body":"From slack:\r\n\r\nI'm confused.  We don't.  The code says we're ready when we have >0 tokens.  Or am I misreading something?\r\n\r\nBryan Boreham [5:38 PM]\r\nlooks to me like you're adding the number of tokens from all ingesters\r\n\r\nTom Wilkie [5:38 PM]\r\nAh yeah we are - good catch\r\nI see what I was trying to do now...\r\nIts actually not a change - d.Tokens used to contain all the tokens (for all nodes)\r\nnot just our tokens (d is the ring \"desc\")\r\n\r\nBryan Boreham [5:40 PM]\r\noh, right\r\n\r\nTom Wilkie [5:40 PM]\r\nThats not to say the logic is correct\r\n(its not _incorrect_ either - it means we won't go ready until someone has tokens, but we want to be more specific)\r\n\r\nBryan Boreham [5:42 PM]\r\nAm I right in thinking the only use of the 'ready' state is to halt a rolling update if things aren't going well?\r\n\r\nTom Wilkie [5:42 PM]\r\nCorrect\r\nits basically saying if the \"ring\" is ready, not the given ingester.\r\nadding a check that we have tokens would be done in the lifecycler.","created_at":"2018-11-09T17:44:07Z","updated_at":"2018-11-09T17:44:08Z","html_url":"https://github.com/cortexproject/cortex/pull/1043#discussion_r232336461","pull_request_url":"https://api.github.com/repos/cortexproject/cortex/pulls/1043","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/cortexproject/cortex/pulls/comments/232336461"},"html":{"href":"https://github.com/cortexproject/cortex/pull/1043#discussion_r232336461"},"pull_request":{"href":"https://api.github.com/repos/cortexproject/cortex/pulls/1043"}},"in_reply_to_id":232305162},"pull_request":{"url":"https://api.github.com/repos/cortexproject/cortex/pulls/1043","id":219076247,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5MDc2MjQ3","html_url":"https://github.com/cortexproject/cortex/pull/1043","diff_url":"https://github.com/cortexproject/cortex/pull/1043.diff","patch_url":"https://github.com/cortexproject/cortex/pull/1043.patch","issue_url":"https://api.github.com/repos/cortexproject/cortex/issues/1043","number":1043,"state":"open","locked":false,"title":"Reduce number of pointers in the ring protos.","user":{"login":"tomwilkie","id":444037,"node_id":"MDQ6VXNlcjQ0NDAzNw==","avatar_url":"https://avatars1.githubusercontent.com/u/444037?v=4","gravatar_id":"","url":"https://api.github.com/users/tomwilkie","html_url":"https://github.com/tomwilkie","followers_url":"https://api.github.com/users/tomwilkie/followers","following_url":"https://api.github.com/users/tomwilkie/following{/other_user}","gists_url":"https://api.github.com/users/tomwilkie/gists{/gist_id}","starred_url":"https://api.github.com/users/tomwilkie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomwilkie/subscriptions","organizations_url":"https://api.github.com/users/tomwilkie/orgs","repos_url":"https://api.github.com/users/tomwilkie/repos","events_url":"https://api.github.com/users/tomwilkie/events{/privacy}","received_events_url":"https://api.github.com/users/tomwilkie/received_events","type":"User","site_admin":false},"body":"Mainly to reduce noise in the heap profiles, I don't expect this will have much practical difference.\r\n\r\nHaven't run in dev yet.\r\n\r\nSigned-off-by: Tom Wilkie <tom.wilkie@gmail.com>","created_at":"2018-09-28T20:23:15Z","updated_at":"2018-11-09T17:44:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0a704a8b2e6f534b68b5037898c6f1b7a43ccaff","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cortexproject/cortex/pulls/1043/commits","review_comments_url":"https://api.github.com/repos/cortexproject/cortex/pulls/1043/comments","review_comment_url":"https://api.github.com/repos/cortexproject/cortex/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cortexproject/cortex/issues/1043/comments","statuses_url":"https://api.github.com/repos/cortexproject/cortex/statuses/7fc521a5ab2b378b8c3e000efd23bfbf534b141a","head":{"label":"grafana:allocs","ref":"allocs","sha":"7fc521a5ab2b378b8c3e000efd23bfbf534b141a","user":{"login":"grafana","id":7195757,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcxOTU3NTc=","avatar_url":"https://avatars0.githubusercontent.com/u/7195757?v=4","gravatar_id":"","url":"https://api.github.com/users/grafana","html_url":"https://github.com/grafana","followers_url":"https://api.github.com/users/grafana/followers","following_url":"https://api.github.com/users/grafana/following{/other_user}","gists_url":"https://api.github.com/users/grafana/gists{/gist_id}","starred_url":"https://api.github.com/users/grafana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grafana/subscriptions","organizations_url":"https://api.github.com/users/grafana/orgs","repos_url":"https://api.github.com/users/grafana/repos","events_url":"https://api.github.com/users/grafana/events{/privacy}","received_events_url":"https://api.github.com/users/grafana/received_events","type":"Organization","site_admin":false},"repo":{"id":126869078,"node_id":"MDEwOlJlcG9zaXRvcnkxMjY4NjkwNzg=","name":"cortex","full_name":"grafana/cortex","private":false,"owner":{"login":"grafana","id":7195757,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcxOTU3NTc=","avatar_url":"https://avatars0.githubusercontent.com/u/7195757?v=4","gravatar_id":"","url":"https://api.github.com/users/grafana","html_url":"https://github.com/grafana","followers_url":"https://api.github.com/users/grafana/followers","following_url":"https://api.github.com/users/grafana/following{/other_user}","gists_url":"https://api.github.com/users/grafana/gists{/gist_id}","starred_url":"https://api.github.com/users/grafana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grafana/subscriptions","organizations_url":"https://api.github.com/users/grafana/orgs","repos_url":"https://api.github.com/users/grafana/repos","events_url":"https://api.github.com/users/grafana/events{/privacy}","received_events_url":"https://api.github.com/users/grafana/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/grafana/cortex","description":"A multitenant, horizontally scalable Prometheus as a Service","fork":true,"url":"https://api.github.com/repos/grafana/cortex","forks_url":"https://api.github.com/repos/grafana/cortex/forks","keys_url":"https://api.github.com/repos/grafana/cortex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grafana/cortex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grafana/cortex/teams","hooks_url":"https://api.github.com/repos/grafana/cortex/hooks","issue_events_url":"https://api.github.com/repos/grafana/cortex/issues/events{/number}","events_url":"https://api.github.com/repos/grafana/cortex/events","assignees_url":"https://api.github.com/repos/grafana/cortex/assignees{/user}","branches_url":"https://api.github.com/repos/grafana/cortex/branches{/branch}","tags_url":"https://api.github.com/repos/grafana/cortex/tags","blobs_url":"https://api.github.com/repos/grafana/cortex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grafana/cortex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grafana/cortex/git/refs{/sha}","trees_url":"https://api.github.com/repos/grafana/cortex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grafana/cortex/statuses/{sha}","languages_url":"https://api.github.com/repos/grafana/cortex/languages","stargazers_url":"https://api.github.com/repos/grafana/cortex/stargazers","contributors_url":"https://api.github.com/repos/grafana/cortex/contributors","subscribers_url":"https://api.github.com/repos/grafana/cortex/subscribers","subscription_url":"https://api.github.com/repos/grafana/cortex/subscription","commits_url":"https://api.github.com/repos/grafana/cortex/commits{/sha}","git_commits_url":"https://api.github.com/repos/grafana/cortex/git/commits{/sha}","comments_url":"https://api.github.com/repos/grafana/cortex/comments{/number}","issue_comment_url":"https://api.github.com/repos/grafana/cortex/issues/comments{/number}","contents_url":"https://api.github.com/repos/grafana/cortex/contents/{+path}","compare_url":"https://api.github.com/repos/grafana/cortex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grafana/cortex/merges","archive_url":"https://api.github.com/repos/grafana/cortex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grafana/cortex/downloads","issues_url":"https://api.github.com/repos/grafana/cortex/issues{/number}","pulls_url":"https://api.github.com/repos/grafana/cortex/pulls{/number}","milestones_url":"https://api.github.com/repos/grafana/cortex/milestones{/number}","notifications_url":"https://api.github.com/repos/grafana/cortex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grafana/cortex/labels{/name}","releases_url":"https://api.github.com/repos/grafana/cortex/releases{/id}","deployments_url":"https://api.github.com/repos/grafana/cortex/deployments","created_at":"2018-03-26T18:02:20Z","updated_at":"2018-09-24T11:53:37Z","pushed_at":"2018-11-09T14:14:09Z","git_url":"git://github.com/grafana/cortex.git","ssh_url":"git@github.com:grafana/cortex.git","clone_url":"https://github.com/grafana/cortex.git","svn_url":"https://github.com/grafana/cortex","homepage":null,"size":26408,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":3,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cortexproject:master","ref":"master","sha":"9f6ad2b8a3a5aaa4c4423ddc615cf84068320704","user":{"login":"cortexproject","id":43045022,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzMDQ1MDIy","avatar_url":"https://avatars1.githubusercontent.com/u/43045022?v=4","gravatar_id":"","url":"https://api.github.com/users/cortexproject","html_url":"https://github.com/cortexproject","followers_url":"https://api.github.com/users/cortexproject/followers","following_url":"https://api.github.com/users/cortexproject/following{/other_user}","gists_url":"https://api.github.com/users/cortexproject/gists{/gist_id}","starred_url":"https://api.github.com/users/cortexproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cortexproject/subscriptions","organizations_url":"https://api.github.com/users/cortexproject/orgs","repos_url":"https://api.github.com/users/cortexproject/repos","events_url":"https://api.github.com/users/cortexproject/events{/privacy}","received_events_url":"https://api.github.com/users/cortexproject/received_events","type":"Organization","site_admin":false},"repo":{"id":67793333,"node_id":"MDEwOlJlcG9zaXRvcnk2Nzc5MzMzMw==","name":"cortex","full_name":"cortexproject/cortex","private":false,"owner":{"login":"cortexproject","id":43045022,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzMDQ1MDIy","avatar_url":"https://avatars1.githubusercontent.com/u/43045022?v=4","gravatar_id":"","url":"https://api.github.com/users/cortexproject","html_url":"https://github.com/cortexproject","followers_url":"https://api.github.com/users/cortexproject/followers","following_url":"https://api.github.com/users/cortexproject/following{/other_user}","gists_url":"https://api.github.com/users/cortexproject/gists{/gist_id}","starred_url":"https://api.github.com/users/cortexproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cortexproject/subscriptions","organizations_url":"https://api.github.com/users/cortexproject/orgs","repos_url":"https://api.github.com/users/cortexproject/repos","events_url":"https://api.github.com/users/cortexproject/events{/privacy}","received_events_url":"https://api.github.com/users/cortexproject/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/cortexproject/cortex","description":"A multitenant, horizontally scalable Prometheus as a Service","fork":false,"url":"https://api.github.com/repos/cortexproject/cortex","forks_url":"https://api.github.com/repos/cortexproject/cortex/forks","keys_url":"https://api.github.com/repos/cortexproject/cortex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cortexproject/cortex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cortexproject/cortex/teams","hooks_url":"https://api.github.com/repos/cortexproject/cortex/hooks","issue_events_url":"https://api.github.com/repos/cortexproject/cortex/issues/events{/number}","events_url":"https://api.github.com/repos/cortexproject/cortex/events","assignees_url":"https://api.github.com/repos/cortexproject/cortex/assignees{/user}","branches_url":"https://api.github.com/repos/cortexproject/cortex/branches{/branch}","tags_url":"https://api.github.com/repos/cortexproject/cortex/tags","blobs_url":"https://api.github.com/repos/cortexproject/cortex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cortexproject/cortex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cortexproject/cortex/git/refs{/sha}","trees_url":"https://api.github.com/repos/cortexproject/cortex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cortexproject/cortex/statuses/{sha}","languages_url":"https://api.github.com/repos/cortexproject/cortex/languages","stargazers_url":"https://api.github.com/repos/cortexproject/cortex/stargazers","contributors_url":"https://api.github.com/repos/cortexproject/cortex/contributors","subscribers_url":"https://api.github.com/repos/cortexproject/cortex/subscribers","subscription_url":"https://api.github.com/repos/cortexproject/cortex/subscription","commits_url":"https://api.github.com/repos/cortexproject/cortex/commits{/sha}","git_commits_url":"https://api.github.com/repos/cortexproject/cortex/git/commits{/sha}","comments_url":"https://api.github.com/repos/cortexproject/cortex/comments{/number}","issue_comment_url":"https://api.github.com/repos/cortexproject/cortex/issues/comments{/number}","contents_url":"https://api.github.com/repos/cortexproject/cortex/contents/{+path}","compare_url":"https://api.github.com/repos/cortexproject/cortex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cortexproject/cortex/merges","archive_url":"https://api.github.com/repos/cortexproject/cortex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cortexproject/cortex/downloads","issues_url":"https://api.github.com/repos/cortexproject/cortex/issues{/number}","pulls_url":"https://api.github.com/repos/cortexproject/cortex/pulls{/number}","milestones_url":"https://api.github.com/repos/cortexproject/cortex/milestones{/number}","notifications_url":"https://api.github.com/repos/cortexproject/cortex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cortexproject/cortex/labels{/name}","releases_url":"https://api.github.com/repos/cortexproject/cortex/releases{/id}","deployments_url":"https://api.github.com/repos/cortexproject/cortex/deployments","created_at":"2016-09-09T11:23:12Z","updated_at":"2018-11-09T16:09:16Z","pushed_at":"2018-11-09T17:03:34Z","git_url":"git://github.com/cortexproject/cortex.git","ssh_url":"git@github.com:cortexproject/cortex.git","clone_url":"https://github.com/cortexproject/cortex.git","svn_url":"https://github.com/cortexproject/cortex","homepage":null,"size":26717,"stargazers_count":760,"watchers_count":760,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":88,"mirror_url":null,"archived":false,"open_issues_count":154,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":88,"open_issues":154,"watchers":760,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cortexproject/cortex/pulls/1043"},"html":{"href":"https://github.com/cortexproject/cortex/pull/1043"},"issue":{"href":"https://api.github.com/repos/cortexproject/cortex/issues/1043"},"comments":{"href":"https://api.github.com/repos/cortexproject/cortex/issues/1043/comments"},"review_comments":{"href":"https://api.github.com/repos/cortexproject/cortex/pulls/1043/comments"},"review_comment":{"href":"https://api.github.com/repos/cortexproject/cortex/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cortexproject/cortex/pulls/1043/commits"},"statuses":{"href":"https://api.github.com/repos/cortexproject/cortex/statuses/7fc521a5ab2b378b8c3e000efd23bfbf534b141a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"tomwilkie"}}