{"action":"created","comment":{"url":"https://api.github.com/repos/openvstorage/alba/pulls/comments/89735078","pull_request_review_id":10271184,"id":89735078,"diff_hunk":"@@ -281,13 +286,48 @@ let download_chunk\n   let fragments = Hashtbl.create n in\n \n   let module CountDownLatch = Lwt_extra2.CountDownLatch in\n-  let successes = CountDownLatch.create ~count:k in\n-  let failures = CountDownLatch.create ~count:(m+1) in\n+  let downloadable_chunk_locations_i, nones =\n+    Alba_client_common.downloadable chunk_locations\n+  in\n+  begin\n+    Lwt_log.debug_f \"download_strategy:%s\"\n+                  (show_download_strategy download_strategy) >>= fun () ->\n+    match download_strategy with\n+    | AllFragments -> Lwt.return (downloadable_chunk_locations_i, k, m+1 - nones)\n+    | LeastAmount  ->\n+       if k = 1\n+       then\n+         begin\n+           Lwt_log.debug_f\n+             \"replication: opportunity to use read_preference:%s\"\n+             ([%show: string list] read_preference)\n+           >>= fun () ->\n+           Alba_client_common.find_prefered_osd\n+             read_preference\n+             osd_access\n+             downloadable_chunk_locations_i\n+           >>= fun prefered_osd_o ->\n+\n+           let target =\n+             match prefered_osd_o with\n+             | None -> List.take 1 downloadable_chunk_locations_i\n+                       (* TODO:maybe randomize? *)","path":"ocaml/src/alba_client_download.ml","position":99,"original_position":99,"commit_id":"d1127534d7a99205c1dac341a1da12fb5ea154a3","original_commit_id":"d1127534d7a99205c1dac341a1da12fb5ea154a3","user":{"login":"toolslive","id":1249832,"avatar_url":"https://avatars.githubusercontent.com/u/1249832?v=3","gravatar_id":"","url":"https://api.github.com/users/toolslive","html_url":"https://github.com/toolslive","followers_url":"https://api.github.com/users/toolslive/followers","following_url":"https://api.github.com/users/toolslive/following{/other_user}","gists_url":"https://api.github.com/users/toolslive/gists{/gist_id}","starred_url":"https://api.github.com/users/toolslive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toolslive/subscriptions","organizations_url":"https://api.github.com/users/toolslive/orgs","repos_url":"https://api.github.com/users/toolslive/repos","events_url":"https://api.github.com/users/toolslive/events{/privacy}","received_events_url":"https://api.github.com/users/toolslive/received_events","type":"User","site_admin":false},"body":"ok.","created_at":"2016-11-28T08:33:57Z","updated_at":"2016-11-28T08:33:57Z","html_url":"https://github.com/openvstorage/alba/pull/457#discussion_r89735078","pull_request_url":"https://api.github.com/repos/openvstorage/alba/pulls/457","_links":{"self":{"href":"https://api.github.com/repos/openvstorage/alba/pulls/comments/89735078"},"html":{"href":"https://github.com/openvstorage/alba/pull/457#discussion_r89735078"},"pull_request":{"href":"https://api.github.com/repos/openvstorage/alba/pulls/457"}}},"pull_request":{"url":"https://api.github.com/repos/openvstorage/alba/pulls/457","id":94810198,"html_url":"https://github.com/openvstorage/alba/pull/457","diff_url":"https://github.com/openvstorage/alba/pull/457.diff","patch_url":"https://github.com/openvstorage/alba/pull/457.patch","issue_url":"https://api.github.com/repos/openvstorage/alba/issues/457","number":457,"state":"open","locked":false,"title":"Local read preference","user":{"login":"toolslive","id":1249832,"avatar_url":"https://avatars.githubusercontent.com/u/1249832?v=3","gravatar_id":"","url":"https://api.github.com/users/toolslive","html_url":"https://github.com/toolslive","followers_url":"https://api.github.com/users/toolslive/followers","following_url":"https://api.github.com/users/toolslive/following{/other_user}","gists_url":"https://api.github.com/users/toolslive/gists{/gist_id}","starred_url":"https://api.github.com/users/toolslive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toolslive/subscriptions","organizations_url":"https://api.github.com/users/toolslive/orgs","repos_url":"https://api.github.com/users/toolslive/repos","events_url":"https://api.github.com/users/toolslive/events{/privacy}","received_events_url":"https://api.github.com/users/toolslive/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-22T13:07:29Z","updated_at":"2016-11-28T08:33:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6de4ca41456ca4dd426ac070813e9cedb0077686","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openvstorage/alba/pulls/457/commits","review_comments_url":"https://api.github.com/repos/openvstorage/alba/pulls/457/comments","review_comment_url":"https://api.github.com/repos/openvstorage/alba/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openvstorage/alba/issues/457/comments","statuses_url":"https://api.github.com/repos/openvstorage/alba/statuses/d1127534d7a99205c1dac341a1da12fb5ea154a3","head":{"label":"openvstorage:local_read_preference","ref":"local_read_preference","sha":"d1127534d7a99205c1dac341a1da12fb5ea154a3","user":{"login":"openvstorage","id":12763393,"avatar_url":"https://avatars.githubusercontent.com/u/12763393?v=3","gravatar_id":"","url":"https://api.github.com/users/openvstorage","html_url":"https://github.com/openvstorage","followers_url":"https://api.github.com/users/openvstorage/followers","following_url":"https://api.github.com/users/openvstorage/following{/other_user}","gists_url":"https://api.github.com/users/openvstorage/gists{/gist_id}","starred_url":"https://api.github.com/users/openvstorage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openvstorage/subscriptions","organizations_url":"https://api.github.com/users/openvstorage/orgs","repos_url":"https://api.github.com/users/openvstorage/repos","events_url":"https://api.github.com/users/openvstorage/events{/privacy}","received_events_url":"https://api.github.com/users/openvstorage/received_events","type":"Organization","site_admin":false},"repo":{"id":38867740,"name":"alba","full_name":"openvstorage/alba","owner":{"login":"openvstorage","id":12763393,"avatar_url":"https://avatars.githubusercontent.com/u/12763393?v=3","gravatar_id":"","url":"https://api.github.com/users/openvstorage","html_url":"https://github.com/openvstorage","followers_url":"https://api.github.com/users/openvstorage/followers","following_url":"https://api.github.com/users/openvstorage/following{/other_user}","gists_url":"https://api.github.com/users/openvstorage/gists{/gist_id}","starred_url":"https://api.github.com/users/openvstorage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openvstorage/subscriptions","organizations_url":"https://api.github.com/users/openvstorage/orgs","repos_url":"https://api.github.com/users/openvstorage/repos","events_url":"https://api.github.com/users/openvstorage/events{/privacy}","received_events_url":"https://api.github.com/users/openvstorage/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openvstorage/alba","description":"Open vStorage ALBA (alternate backend) creates a replicated or flexible network raid’ed  object storage backend out of Seagate Kinetic drives and local disk supporting compression, encryption.","fork":false,"url":"https://api.github.com/repos/openvstorage/alba","forks_url":"https://api.github.com/repos/openvstorage/alba/forks","keys_url":"https://api.github.com/repos/openvstorage/alba/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openvstorage/alba/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openvstorage/alba/teams","hooks_url":"https://api.github.com/repos/openvstorage/alba/hooks","issue_events_url":"https://api.github.com/repos/openvstorage/alba/issues/events{/number}","events_url":"https://api.github.com/repos/openvstorage/alba/events","assignees_url":"https://api.github.com/repos/openvstorage/alba/assignees{/user}","branches_url":"https://api.github.com/repos/openvstorage/alba/branches{/branch}","tags_url":"https://api.github.com/repos/openvstorage/alba/tags","blobs_url":"https://api.github.com/repos/openvstorage/alba/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openvstorage/alba/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openvstorage/alba/git/refs{/sha}","trees_url":"https://api.github.com/repos/openvstorage/alba/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openvstorage/alba/statuses/{sha}","languages_url":"https://api.github.com/repos/openvstorage/alba/languages","stargazers_url":"https://api.github.com/repos/openvstorage/alba/stargazers","contributors_url":"https://api.github.com/repos/openvstorage/alba/contributors","subscribers_url":"https://api.github.com/repos/openvstorage/alba/subscribers","subscription_url":"https://api.github.com/repos/openvstorage/alba/subscription","commits_url":"https://api.github.com/repos/openvstorage/alba/commits{/sha}","git_commits_url":"https://api.github.com/repos/openvstorage/alba/git/commits{/sha}","comments_url":"https://api.github.com/repos/openvstorage/alba/comments{/number}","issue_comment_url":"https://api.github.com/repos/openvstorage/alba/issues/comments{/number}","contents_url":"https://api.github.com/repos/openvstorage/alba/contents/{+path}","compare_url":"https://api.github.com/repos/openvstorage/alba/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openvstorage/alba/merges","archive_url":"https://api.github.com/repos/openvstorage/alba/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openvstorage/alba/downloads","issues_url":"https://api.github.com/repos/openvstorage/alba/issues{/number}","pulls_url":"https://api.github.com/repos/openvstorage/alba/pulls{/number}","milestones_url":"https://api.github.com/repos/openvstorage/alba/milestones{/number}","notifications_url":"https://api.github.com/repos/openvstorage/alba/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openvstorage/alba/labels{/name}","releases_url":"https://api.github.com/repos/openvstorage/alba/releases{/id}","deployments_url":"https://api.github.com/repos/openvstorage/alba/deployments","created_at":"2015-07-10T07:40:52Z","updated_at":"2016-10-25T09:54:12Z","pushed_at":"2016-11-26T09:48:51Z","git_url":"git://github.com/openvstorage/alba.git","ssh_url":"git@github.com:openvstorage/alba.git","clone_url":"https://github.com/openvstorage/alba.git","svn_url":"https://github.com/openvstorage/alba","homepage":"","size":35676,"stargazers_count":15,"watchers_count":15,"language":"OCaml","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":43,"forks":4,"open_issues":43,"watchers":15,"default_branch":"master"}},"base":{"label":"openvstorage:master","ref":"master","sha":"41f7967b2eb5ad626b793c4291cef89fd720dde1","user":{"login":"openvstorage","id":12763393,"avatar_url":"https://avatars.githubusercontent.com/u/12763393?v=3","gravatar_id":"","url":"https://api.github.com/users/openvstorage","html_url":"https://github.com/openvstorage","followers_url":"https://api.github.com/users/openvstorage/followers","following_url":"https://api.github.com/users/openvstorage/following{/other_user}","gists_url":"https://api.github.com/users/openvstorage/gists{/gist_id}","starred_url":"https://api.github.com/users/openvstorage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openvstorage/subscriptions","organizations_url":"https://api.github.com/users/openvstorage/orgs","repos_url":"https://api.github.com/users/openvstorage/repos","events_url":"https://api.github.com/users/openvstorage/events{/privacy}","received_events_url":"https://api.github.com/users/openvstorage/received_events","type":"Organization","site_admin":false},"repo":{"id":38867740,"name":"alba","full_name":"openvstorage/alba","owner":{"login":"openvstorage","id":12763393,"avatar_url":"https://avatars.githubusercontent.com/u/12763393?v=3","gravatar_id":"","url":"https://api.github.com/users/openvstorage","html_url":"https://github.com/openvstorage","followers_url":"https://api.github.com/users/openvstorage/followers","following_url":"https://api.github.com/users/openvstorage/following{/other_user}","gists_url":"https://api.github.com/users/openvstorage/gists{/gist_id}","starred_url":"https://api.github.com/users/openvstorage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openvstorage/subscriptions","organizations_url":"https://api.github.com/users/openvstorage/orgs","repos_url":"https://api.github.com/users/openvstorage/repos","events_url":"https://api.github.com/users/openvstorage/events{/privacy}","received_events_url":"https://api.github.com/users/openvstorage/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openvstorage/alba","description":"Open vStorage ALBA (alternate backend) creates a replicated or flexible network raid’ed  object storage backend out of Seagate Kinetic drives and local disk supporting compression, encryption.","fork":false,"url":"https://api.github.com/repos/openvstorage/alba","forks_url":"https://api.github.com/repos/openvstorage/alba/forks","keys_url":"https://api.github.com/repos/openvstorage/alba/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openvstorage/alba/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openvstorage/alba/teams","hooks_url":"https://api.github.com/repos/openvstorage/alba/hooks","issue_events_url":"https://api.github.com/repos/openvstorage/alba/issues/events{/number}","events_url":"https://api.github.com/repos/openvstorage/alba/events","assignees_url":"https://api.github.com/repos/openvstorage/alba/assignees{/user}","branches_url":"https://api.github.com/repos/openvstorage/alba/branches{/branch}","tags_url":"https://api.github.com/repos/openvstorage/alba/tags","blobs_url":"https://api.github.com/repos/openvstorage/alba/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openvstorage/alba/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openvstorage/alba/git/refs{/sha}","trees_url":"https://api.github.com/repos/openvstorage/alba/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openvstorage/alba/statuses/{sha}","languages_url":"https://api.github.com/repos/openvstorage/alba/languages","stargazers_url":"https://api.github.com/repos/openvstorage/alba/stargazers","contributors_url":"https://api.github.com/repos/openvstorage/alba/contributors","subscribers_url":"https://api.github.com/repos/openvstorage/alba/subscribers","subscription_url":"https://api.github.com/repos/openvstorage/alba/subscription","commits_url":"https://api.github.com/repos/openvstorage/alba/commits{/sha}","git_commits_url":"https://api.github.com/repos/openvstorage/alba/git/commits{/sha}","comments_url":"https://api.github.com/repos/openvstorage/alba/comments{/number}","issue_comment_url":"https://api.github.com/repos/openvstorage/alba/issues/comments{/number}","contents_url":"https://api.github.com/repos/openvstorage/alba/contents/{+path}","compare_url":"https://api.github.com/repos/openvstorage/alba/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openvstorage/alba/merges","archive_url":"https://api.github.com/repos/openvstorage/alba/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openvstorage/alba/downloads","issues_url":"https://api.github.com/repos/openvstorage/alba/issues{/number}","pulls_url":"https://api.github.com/repos/openvstorage/alba/pulls{/number}","milestones_url":"https://api.github.com/repos/openvstorage/alba/milestones{/number}","notifications_url":"https://api.github.com/repos/openvstorage/alba/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openvstorage/alba/labels{/name}","releases_url":"https://api.github.com/repos/openvstorage/alba/releases{/id}","deployments_url":"https://api.github.com/repos/openvstorage/alba/deployments","created_at":"2015-07-10T07:40:52Z","updated_at":"2016-10-25T09:54:12Z","pushed_at":"2016-11-26T09:48:51Z","git_url":"git://github.com/openvstorage/alba.git","ssh_url":"git@github.com:openvstorage/alba.git","clone_url":"https://github.com/openvstorage/alba.git","svn_url":"https://github.com/openvstorage/alba","homepage":"","size":35676,"stargazers_count":15,"watchers_count":15,"language":"OCaml","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":43,"forks":4,"open_issues":43,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openvstorage/alba/pulls/457"},"html":{"href":"https://github.com/openvstorage/alba/pull/457"},"issue":{"href":"https://api.github.com/repos/openvstorage/alba/issues/457"},"comments":{"href":"https://api.github.com/repos/openvstorage/alba/issues/457/comments"},"review_comments":{"href":"https://api.github.com/repos/openvstorage/alba/pulls/457/comments"},"review_comment":{"href":"https://api.github.com/repos/openvstorage/alba/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openvstorage/alba/pulls/457/commits"},"statuses":{"href":"https://api.github.com/repos/openvstorage/alba/statuses/d1127534d7a99205c1dac341a1da12fb5ea154a3"}}}}
{"actor":{"display_login":"toolslive"}}