{"action":"created","comment":{"url":"https://api.github.com/repos/m3db/m3coordinator/pulls/comments/168294973","pull_request_review_id":96639340,"id":168294973,"diff_hunk":"@@ -19,14 +22,69 @@ func NewStorage(stores []storage.Storage, filter filter.Storage) storage.Storage\n \n func (s *fanoutStorage) Fetch(ctx context.Context, query *storage.FetchQuery, options *storage.FetchOptions) (*storage.FetchResult, error) {\n \tstores := filterStores(s.stores, s.filter, query)\n-\t//TODO: Actual fanout\n-\treturn stores[0].Fetch(ctx, query, options)\n+\trequests := make([]execution.Request, len(stores))\n+\tfor idx, store := range stores {\n+\t\trequests[idx] = newFetchRequest(ctx, store, query, options, idx)\n+\t}\n+\n+\tresponses := execution.ExecuteParallel(requests)\n+\treturn handleFetchResponses(requests, responses)\n+}\n+\n+func handleFetchResponses(requests []execution.Request, responses []*execution.Response) (*storage.FetchResult, error) {\n+\tif len(requests) != len(responses) {\n+\t\treturn nil, fmt.Errorf(\"invalid response from fetch\")\n+\t}\n+\n+\tseriesList := make([]*ts.Series, 0, len(requests))\n+\tresult := &storage.FetchResult{SeriesList: seriesList, LocalOnly: true}\n+\tfor idx, res := range responses {\n+\t\tif requests[idx].Order() != res.Order {\n+\t\t\treturn nil, fmt.Errorf(\"responses out of order for fetch\")\n+\t\t}\n+\n+\t\t// This type cast can be removed if we were to create a slice of *fetchRequest instead\n+\t\tfetchreq, ok := requests[idx].(*fetchRequest)","path":"storage/fanout/storage.go","position":41,"original_position":41,"commit_id":"2904d09ff2ed41efb7c21f4efa33a3190e103970","original_commit_id":"ea56631fb3379e3e31872648e21c478392abf1b8","user":{"login":"arnikola","id":14959893,"avatar_url":"https://avatars0.githubusercontent.com/u/14959893?v=4","gravatar_id":"","url":"https://api.github.com/users/arnikola","html_url":"https://github.com/arnikola","followers_url":"https://api.github.com/users/arnikola/followers","following_url":"https://api.github.com/users/arnikola/following{/other_user}","gists_url":"https://api.github.com/users/arnikola/gists{/gist_id}","starred_url":"https://api.github.com/users/arnikola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arnikola/subscriptions","organizations_url":"https://api.github.com/users/arnikola/orgs","repos_url":"https://api.github.com/users/arnikola/repos","events_url":"https://api.github.com/users/arnikola/events{/privacy}","received_events_url":"https://api.github.com/users/arnikola/received_events","type":"User","site_admin":false},"body":"Just a side effect of the way the CR is laid out, when I read this thought that `.Order()` might do some processing, but makes sense since it just checks the internal value","created_at":"2018-02-14T20:06:33Z","updated_at":"2018-02-14T20:06:33Z","html_url":"https://github.com/m3db/m3coordinator/pull/20#discussion_r168294973","pull_request_url":"https://api.github.com/repos/m3db/m3coordinator/pulls/20","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/m3db/m3coordinator/pulls/comments/168294973"},"html":{"href":"https://github.com/m3db/m3coordinator/pull/20#discussion_r168294973"},"pull_request":{"href":"https://api.github.com/repos/m3db/m3coordinator/pulls/20"}},"in_reply_to_id":168258582},"pull_request":{"url":"https://api.github.com/repos/m3db/m3coordinator/pulls/20","id":169165035,"html_url":"https://github.com/m3db/m3coordinator/pull/20","diff_url":"https://github.com/m3db/m3coordinator/pull/20.diff","patch_url":"https://github.com/m3db/m3coordinator/pull/20.patch","issue_url":"https://api.github.com/repos/m3db/m3coordinator/issues/20","number":20,"state":"open","locked":false,"title":"Add fanout storage which can query multiple storages in parallel","user":{"login":"nikunjgit","id":1733496,"avatar_url":"https://avatars3.githubusercontent.com/u/1733496?v=4","gravatar_id":"","url":"https://api.github.com/users/nikunjgit","html_url":"https://github.com/nikunjgit","followers_url":"https://api.github.com/users/nikunjgit/followers","following_url":"https://api.github.com/users/nikunjgit/following{/other_user}","gists_url":"https://api.github.com/users/nikunjgit/gists{/gist_id}","starred_url":"https://api.github.com/users/nikunjgit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikunjgit/subscriptions","organizations_url":"https://api.github.com/users/nikunjgit/orgs","repos_url":"https://api.github.com/users/nikunjgit/repos","events_url":"https://api.github.com/users/nikunjgit/events{/privacy}","received_events_url":"https://api.github.com/users/nikunjgit/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-14T16:54:22Z","updated_at":"2018-02-14T20:06:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"933b75b4e1395a6569521f4d3d59bc429f3481b7","assignee":null,"assignees":[],"requested_reviewers":[{"login":"benraskin92","id":4688976,"avatar_url":"https://avatars0.githubusercontent.com/u/4688976?v=4","gravatar_id":"","url":"https://api.github.com/users/benraskin92","html_url":"https://github.com/benraskin92","followers_url":"https://api.github.com/users/benraskin92/followers","following_url":"https://api.github.com/users/benraskin92/following{/other_user}","gists_url":"https://api.github.com/users/benraskin92/gists{/gist_id}","starred_url":"https://api.github.com/users/benraskin92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benraskin92/subscriptions","organizations_url":"https://api.github.com/users/benraskin92/orgs","repos_url":"https://api.github.com/users/benraskin92/repos","events_url":"https://api.github.com/users/benraskin92/events{/privacy}","received_events_url":"https://api.github.com/users/benraskin92/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/m3db/m3coordinator/pulls/20/commits","review_comments_url":"https://api.github.com/repos/m3db/m3coordinator/pulls/20/comments","review_comment_url":"https://api.github.com/repos/m3db/m3coordinator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/m3db/m3coordinator/issues/20/comments","statuses_url":"https://api.github.com/repos/m3db/m3coordinator/statuses/2904d09ff2ed41efb7c21f4efa33a3190e103970","head":{"label":"m3db:fanout","ref":"fanout","sha":"2904d09ff2ed41efb7c21f4efa33a3190e103970","user":{"login":"m3db","id":19937171,"avatar_url":"https://avatars0.githubusercontent.com/u/19937171?v=4","gravatar_id":"","url":"https://api.github.com/users/m3db","html_url":"https://github.com/m3db","followers_url":"https://api.github.com/users/m3db/followers","following_url":"https://api.github.com/users/m3db/following{/other_user}","gists_url":"https://api.github.com/users/m3db/gists{/gist_id}","starred_url":"https://api.github.com/users/m3db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m3db/subscriptions","organizations_url":"https://api.github.com/users/m3db/orgs","repos_url":"https://api.github.com/users/m3db/repos","events_url":"https://api.github.com/users/m3db/events{/privacy}","received_events_url":"https://api.github.com/users/m3db/received_events","type":"Organization","site_admin":false},"repo":{"id":110602995,"name":"m3coordinator","full_name":"m3db/m3coordinator","owner":{"login":"m3db","id":19937171,"avatar_url":"https://avatars0.githubusercontent.com/u/19937171?v=4","gravatar_id":"","url":"https://api.github.com/users/m3db","html_url":"https://github.com/m3db","followers_url":"https://api.github.com/users/m3db/followers","following_url":"https://api.github.com/users/m3db/following{/other_user}","gists_url":"https://api.github.com/users/m3db/gists{/gist_id}","starred_url":"https://api.github.com/users/m3db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m3db/subscriptions","organizations_url":"https://api.github.com/users/m3db/orgs","repos_url":"https://api.github.com/users/m3db/repos","events_url":"https://api.github.com/users/m3db/events{/privacy}","received_events_url":"https://api.github.com/users/m3db/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/m3db/m3coordinator","description":"Service to access M3DB","fork":false,"url":"https://api.github.com/repos/m3db/m3coordinator","forks_url":"https://api.github.com/repos/m3db/m3coordinator/forks","keys_url":"https://api.github.com/repos/m3db/m3coordinator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/m3db/m3coordinator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/m3db/m3coordinator/teams","hooks_url":"https://api.github.com/repos/m3db/m3coordinator/hooks","issue_events_url":"https://api.github.com/repos/m3db/m3coordinator/issues/events{/number}","events_url":"https://api.github.com/repos/m3db/m3coordinator/events","assignees_url":"https://api.github.com/repos/m3db/m3coordinator/assignees{/user}","branches_url":"https://api.github.com/repos/m3db/m3coordinator/branches{/branch}","tags_url":"https://api.github.com/repos/m3db/m3coordinator/tags","blobs_url":"https://api.github.com/repos/m3db/m3coordinator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/m3db/m3coordinator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/m3db/m3coordinator/git/refs{/sha}","trees_url":"https://api.github.com/repos/m3db/m3coordinator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/m3db/m3coordinator/statuses/{sha}","languages_url":"https://api.github.com/repos/m3db/m3coordinator/languages","stargazers_url":"https://api.github.com/repos/m3db/m3coordinator/stargazers","contributors_url":"https://api.github.com/repos/m3db/m3coordinator/contributors","subscribers_url":"https://api.github.com/repos/m3db/m3coordinator/subscribers","subscription_url":"https://api.github.com/repos/m3db/m3coordinator/subscription","commits_url":"https://api.github.com/repos/m3db/m3coordinator/commits{/sha}","git_commits_url":"https://api.github.com/repos/m3db/m3coordinator/git/commits{/sha}","comments_url":"https://api.github.com/repos/m3db/m3coordinator/comments{/number}","issue_comment_url":"https://api.github.com/repos/m3db/m3coordinator/issues/comments{/number}","contents_url":"https://api.github.com/repos/m3db/m3coordinator/contents/{+path}","compare_url":"https://api.github.com/repos/m3db/m3coordinator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/m3db/m3coordinator/merges","archive_url":"https://api.github.com/repos/m3db/m3coordinator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/m3db/m3coordinator/downloads","issues_url":"https://api.github.com/repos/m3db/m3coordinator/issues{/number}","pulls_url":"https://api.github.com/repos/m3db/m3coordinator/pulls{/number}","milestones_url":"https://api.github.com/repos/m3db/m3coordinator/milestones{/number}","notifications_url":"https://api.github.com/repos/m3db/m3coordinator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/m3db/m3coordinator/labels{/name}","releases_url":"https://api.github.com/repos/m3db/m3coordinator/releases{/id}","deployments_url":"https://api.github.com/repos/m3db/m3coordinator/deployments","created_at":"2017-11-13T21:14:11Z","updated_at":"2017-12-14T20:15:07Z","pushed_at":"2018-02-14T19:48:20Z","git_url":"git://github.com/m3db/m3coordinator.git","ssh_url":"git@github.com:m3db/m3coordinator.git","clone_url":"https://github.com/m3db/m3coordinator.git","svn_url":"https://github.com/m3db/m3coordinator","homepage":null,"size":714,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"m3db:master","ref":"master","sha":"a45b5815c704ca2eefedb423b6ee9a644aabb518","user":{"login":"m3db","id":19937171,"avatar_url":"https://avatars0.githubusercontent.com/u/19937171?v=4","gravatar_id":"","url":"https://api.github.com/users/m3db","html_url":"https://github.com/m3db","followers_url":"https://api.github.com/users/m3db/followers","following_url":"https://api.github.com/users/m3db/following{/other_user}","gists_url":"https://api.github.com/users/m3db/gists{/gist_id}","starred_url":"https://api.github.com/users/m3db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m3db/subscriptions","organizations_url":"https://api.github.com/users/m3db/orgs","repos_url":"https://api.github.com/users/m3db/repos","events_url":"https://api.github.com/users/m3db/events{/privacy}","received_events_url":"https://api.github.com/users/m3db/received_events","type":"Organization","site_admin":false},"repo":{"id":110602995,"name":"m3coordinator","full_name":"m3db/m3coordinator","owner":{"login":"m3db","id":19937171,"avatar_url":"https://avatars0.githubusercontent.com/u/19937171?v=4","gravatar_id":"","url":"https://api.github.com/users/m3db","html_url":"https://github.com/m3db","followers_url":"https://api.github.com/users/m3db/followers","following_url":"https://api.github.com/users/m3db/following{/other_user}","gists_url":"https://api.github.com/users/m3db/gists{/gist_id}","starred_url":"https://api.github.com/users/m3db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m3db/subscriptions","organizations_url":"https://api.github.com/users/m3db/orgs","repos_url":"https://api.github.com/users/m3db/repos","events_url":"https://api.github.com/users/m3db/events{/privacy}","received_events_url":"https://api.github.com/users/m3db/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/m3db/m3coordinator","description":"Service to access M3DB","fork":false,"url":"https://api.github.com/repos/m3db/m3coordinator","forks_url":"https://api.github.com/repos/m3db/m3coordinator/forks","keys_url":"https://api.github.com/repos/m3db/m3coordinator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/m3db/m3coordinator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/m3db/m3coordinator/teams","hooks_url":"https://api.github.com/repos/m3db/m3coordinator/hooks","issue_events_url":"https://api.github.com/repos/m3db/m3coordinator/issues/events{/number}","events_url":"https://api.github.com/repos/m3db/m3coordinator/events","assignees_url":"https://api.github.com/repos/m3db/m3coordinator/assignees{/user}","branches_url":"https://api.github.com/repos/m3db/m3coordinator/branches{/branch}","tags_url":"https://api.github.com/repos/m3db/m3coordinator/tags","blobs_url":"https://api.github.com/repos/m3db/m3coordinator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/m3db/m3coordinator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/m3db/m3coordinator/git/refs{/sha}","trees_url":"https://api.github.com/repos/m3db/m3coordinator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/m3db/m3coordinator/statuses/{sha}","languages_url":"https://api.github.com/repos/m3db/m3coordinator/languages","stargazers_url":"https://api.github.com/repos/m3db/m3coordinator/stargazers","contributors_url":"https://api.github.com/repos/m3db/m3coordinator/contributors","subscribers_url":"https://api.github.com/repos/m3db/m3coordinator/subscribers","subscription_url":"https://api.github.com/repos/m3db/m3coordinator/subscription","commits_url":"https://api.github.com/repos/m3db/m3coordinator/commits{/sha}","git_commits_url":"https://api.github.com/repos/m3db/m3coordinator/git/commits{/sha}","comments_url":"https://api.github.com/repos/m3db/m3coordinator/comments{/number}","issue_comment_url":"https://api.github.com/repos/m3db/m3coordinator/issues/comments{/number}","contents_url":"https://api.github.com/repos/m3db/m3coordinator/contents/{+path}","compare_url":"https://api.github.com/repos/m3db/m3coordinator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/m3db/m3coordinator/merges","archive_url":"https://api.github.com/repos/m3db/m3coordinator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/m3db/m3coordinator/downloads","issues_url":"https://api.github.com/repos/m3db/m3coordinator/issues{/number}","pulls_url":"https://api.github.com/repos/m3db/m3coordinator/pulls{/number}","milestones_url":"https://api.github.com/repos/m3db/m3coordinator/milestones{/number}","notifications_url":"https://api.github.com/repos/m3db/m3coordinator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/m3db/m3coordinator/labels{/name}","releases_url":"https://api.github.com/repos/m3db/m3coordinator/releases{/id}","deployments_url":"https://api.github.com/repos/m3db/m3coordinator/deployments","created_at":"2017-11-13T21:14:11Z","updated_at":"2017-12-14T20:15:07Z","pushed_at":"2018-02-14T19:48:20Z","git_url":"git://github.com/m3db/m3coordinator.git","ssh_url":"git@github.com:m3db/m3coordinator.git","clone_url":"https://github.com/m3db/m3coordinator.git","svn_url":"https://github.com/m3db/m3coordinator","homepage":null,"size":714,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/m3db/m3coordinator/pulls/20"},"html":{"href":"https://github.com/m3db/m3coordinator/pull/20"},"issue":{"href":"https://api.github.com/repos/m3db/m3coordinator/issues/20"},"comments":{"href":"https://api.github.com/repos/m3db/m3coordinator/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/m3db/m3coordinator/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/m3db/m3coordinator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/m3db/m3coordinator/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/m3db/m3coordinator/statuses/2904d09ff2ed41efb7c21f4efa33a3190e103970"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"arnikola"}}