{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/open-service-broker-azure/pulls/comments/209817262","pull_request_review_id":145903418,"id":209817262,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwOTgxNzI2Mg==","diff_hunk":"@@ -178,3 +182,216 @@ func deleteDatabase(\n \t}\n \treturn nil\n }\n+\n+// The deployment will return success once the write region is created,\n+// ignoring the status of read regions , so we must implement detection logic\n+// by ourselves.\n+func (c *cosmosAccountManager) waitForReadLocationsReady(\n+\tctx context.Context,\n+\tinstance service.Instance,\n+) (service.InstanceDetails, error) {\n+\tdt := instance.Details.(*cosmosdbInstanceDetails)\n+\tresourceGroupName := instance.ProvisioningParameters.GetString(\"resourceGroup\")\n+\taccountName := dt.DatabaseAccountName\n+\tdatabaseAccountClient := c.databaseAccountsClient\n+\n+\terr := pollingUntilReadLocationsReady(\n+\t\tctx,\n+\t\tresourceGroupName,\n+\t\taccountName,\n+\t\tdatabaseAccountClient,\n+\t)\n+\tif err != nil {\n+\t\treturn nil, err\n+\t}\n+\treturn dt, nil\n+}\n+\n+// For sqlAllInOneManager, the real type of `instance.Details` is\n+// `*sqlAllInOneInstanceDetails`, so type assertion must be changed.\n+// Expect type assertion, this function is totally the same as previous one.\n+func (s *sqlAllInOneManager) waitForReadLocationsReady(\n+\tctx context.Context,\n+\tinstance service.Instance,\n+) (service.InstanceDetails, error) {\n+\tdt := instance.Details.(*sqlAllInOneInstanceDetails)\n+\tresourceGroupName := instance.ProvisioningParameters.GetString(\"resourceGroup\")\n+\taccountName := dt.DatabaseAccountName\n+\tdatabaseAccountClient := s.databaseAccountsClient\n+\n+\terr := pollingUntilReadLocationsReady(\n+\t\tctx,\n+\t\tresourceGroupName,\n+\t\taccountName,\n+\t\tdatabaseAccountClient,\n+\t)\n+\tif err != nil {\n+\t\treturn nil, err\n+\t}\n+\treturn dt, nil\n+}\n+\n+const succeeded = \"succeeded\"\n+\n+// For now, this method will return on either context is cancelled or\n+// every region's state is \"succeeded\" in seven consecutive check.\n+// The reason why we need seven consecutive check is that\n+// the read region is created one by one, there is a small gap between\n+// the finishment of previous creation and the start of the next creation.\n+// By this check, we can detect gaps shorter than 1 mintue,\n+// and report success within 70 seconds after completion.","path":"pkg/services/cosmosdb/cosmos-utils.go","position":null,"original_position":79,"commit_id":"c4b81c5649a7f7eae9cd909b7b8f9c1ffed005d3","original_commit_id":"6d88b9794501acf158066fef2b409bb71914f4f8","user":{"login":"norshtein","id":12193736,"node_id":"MDQ6VXNlcjEyMTkzNzM2","avatar_url":"https://avatars0.githubusercontent.com/u/12193736?v=4","gravatar_id":"","url":"https://api.github.com/users/norshtein","html_url":"https://github.com/norshtein","followers_url":"https://api.github.com/users/norshtein/followers","following_url":"https://api.github.com/users/norshtein/following{/other_user}","gists_url":"https://api.github.com/users/norshtein/gists{/gist_id}","starred_url":"https://api.github.com/users/norshtein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/norshtein/subscriptions","organizations_url":"https://api.github.com/users/norshtein/orgs","repos_url":"https://api.github.com/users/norshtein/repos","events_url":"https://api.github.com/users/norshtein/events{/privacy}","received_events_url":"https://api.github.com/users/norshtein/received_events","type":"User","site_admin":false},"body":"Hi @krancour , for now, we can't make the creation in parallel. The underlying creation is managed by Cosmos team, currently the creation is serial on both Azure portal and go-sdk.","created_at":"2018-08-14T03:07:13Z","updated_at":"2018-08-14T03:07:13Z","html_url":"https://github.com/Azure/open-service-broker-azure/pull/544#discussion_r209817262","pull_request_url":"https://api.github.com/repos/Azure/open-service-broker-azure/pulls/544","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Azure/open-service-broker-azure/pulls/comments/209817262"},"html":{"href":"https://github.com/Azure/open-service-broker-azure/pull/544#discussion_r209817262"},"pull_request":{"href":"https://api.github.com/repos/Azure/open-service-broker-azure/pulls/544"}},"in_reply_to_id":209647876},"pull_request":{"url":"https://api.github.com/repos/Azure/open-service-broker-azure/pulls/544","id":207311028,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3MzExMDI4","html_url":"https://github.com/Azure/open-service-broker-azure/pull/544","diff_url":"https://github.com/Azure/open-service-broker-azure/pull/544.diff","patch_url":"https://github.com/Azure/open-service-broker-azure/pull/544.patch","issue_url":"https://api.github.com/repos/Azure/open-service-broker-azure/issues/544","number":544,"state":"open","locked":false,"title":"Enable Configuring read regions and auto failover in CosmosDB","user":{"login":"norshtein","id":12193736,"node_id":"MDQ6VXNlcjEyMTkzNzM2","avatar_url":"https://avatars0.githubusercontent.com/u/12193736?v=4","gravatar_id":"","url":"https://api.github.com/users/norshtein","html_url":"https://github.com/norshtein","followers_url":"https://api.github.com/users/norshtein/followers","following_url":"https://api.github.com/users/norshtein/following{/other_user}","gists_url":"https://api.github.com/users/norshtein/gists{/gist_id}","starred_url":"https://api.github.com/users/norshtein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/norshtein/subscriptions","organizations_url":"https://api.github.com/users/norshtein/orgs","repos_url":"https://api.github.com/users/norshtein/repos","events_url":"https://api.github.com/users/norshtein/events{/privacy}","received_events_url":"https://api.github.com/users/norshtein/received_events","type":"User","site_admin":false},"body":"Hi, this pr enables configuring read regions and auto failover in CosmosDB in following services:\r\n- azure-cosmosdb-sql\r\n- azure-cosmosdb-sql-account\r\n- azure-cosmosdb-mongo-account\r\n- azure-cosmosdb-table-account\r\n- azure-cosmosdb-graph-account\r\n\r\nIn the provision and update step in these services, I add two parameter: `readRegions` and `autoFailoverEnabled`, customers can use these two parameters to manage geo-replication of the cosmos account. \r\nDocument has been added. Life cycle test case has been added. Feel free to contact me if you have any question.","created_at":"2018-08-09T13:10:42Z","updated_at":"2018-08-14T03:07:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"33e5b4e13f48f26932b661178f4e0e52d355eb57","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/open-service-broker-azure/pulls/544/commits","review_comments_url":"https://api.github.com/repos/Azure/open-service-broker-azure/pulls/544/comments","review_comment_url":"https://api.github.com/repos/Azure/open-service-broker-azure/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/open-service-broker-azure/issues/544/comments","statuses_url":"https://api.github.com/repos/Azure/open-service-broker-azure/statuses/c4b81c5649a7f7eae9cd909b7b8f9c1ffed005d3","head":{"label":"norshtein:cosmos-pr-clean-commit","ref":"cosmos-pr-clean-commit","sha":"c4b81c5649a7f7eae9cd909b7b8f9c1ffed005d3","user":{"login":"norshtein","id":12193736,"node_id":"MDQ6VXNlcjEyMTkzNzM2","avatar_url":"https://avatars0.githubusercontent.com/u/12193736?v=4","gravatar_id":"","url":"https://api.github.com/users/norshtein","html_url":"https://github.com/norshtein","followers_url":"https://api.github.com/users/norshtein/followers","following_url":"https://api.github.com/users/norshtein/following{/other_user}","gists_url":"https://api.github.com/users/norshtein/gists{/gist_id}","starred_url":"https://api.github.com/users/norshtein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/norshtein/subscriptions","organizations_url":"https://api.github.com/users/norshtein/orgs","repos_url":"https://api.github.com/users/norshtein/repos","events_url":"https://api.github.com/users/norshtein/events{/privacy}","received_events_url":"https://api.github.com/users/norshtein/received_events","type":"User","site_admin":false},"repo":{"id":135979325,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU5NzkzMjU=","name":"open-service-broker-azure","full_name":"norshtein/open-service-broker-azure","owner":{"login":"norshtein","id":12193736,"node_id":"MDQ6VXNlcjEyMTkzNzM2","avatar_url":"https://avatars0.githubusercontent.com/u/12193736?v=4","gravatar_id":"","url":"https://api.github.com/users/norshtein","html_url":"https://github.com/norshtein","followers_url":"https://api.github.com/users/norshtein/followers","following_url":"https://api.github.com/users/norshtein/following{/other_user}","gists_url":"https://api.github.com/users/norshtein/gists{/gist_id}","starred_url":"https://api.github.com/users/norshtein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/norshtein/subscriptions","organizations_url":"https://api.github.com/users/norshtein/orgs","repos_url":"https://api.github.com/users/norshtein/repos","events_url":"https://api.github.com/users/norshtein/events{/privacy}","received_events_url":"https://api.github.com/users/norshtein/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/norshtein/open-service-broker-azure","description":"The Open Service Broker API Server for Azure Services","fork":true,"url":"https://api.github.com/repos/norshtein/open-service-broker-azure","forks_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/forks","keys_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/keys{/key_id}","collaborators_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/teams","hooks_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/hooks","issue_events_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/issues/events{/number}","events_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/events","assignees_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/assignees{/user}","branches_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/branches{/branch}","tags_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/tags","blobs_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/git/refs{/sha}","trees_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/git/trees{/sha}","statuses_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/statuses/{sha}","languages_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/languages","stargazers_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/stargazers","contributors_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/contributors","subscribers_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/subscribers","subscription_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/subscription","commits_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/commits{/sha}","git_commits_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/git/commits{/sha}","comments_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/comments{/number}","issue_comment_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/issues/comments{/number}","contents_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/contents/{+path}","compare_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/compare/{base}...{head}","merges_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/merges","archive_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/downloads","issues_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/issues{/number}","pulls_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/pulls{/number}","milestones_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/milestones{/number}","notifications_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/labels{/name}","releases_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/releases{/id}","deployments_url":"https://api.github.com/repos/norshtein/open-service-broker-azure/deployments","created_at":"2018-06-04T06:18:13Z","updated_at":"2018-06-04T06:18:15Z","pushed_at":"2018-08-14T02:52:57Z","git_url":"git://github.com/norshtein/open-service-broker-azure.git","ssh_url":"git@github.com:norshtein/open-service-broker-azure.git","clone_url":"https://github.com/norshtein/open-service-broker-azure.git","svn_url":"https://github.com/norshtein/open-service-broker-azure","homepage":"https://osba.sh","size":22563,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Azure:master","ref":"master","sha":"15b7e8e9508d92faee7b0a53e0c831841b1e6623","user":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":107195510,"node_id":"MDEwOlJlcG9zaXRvcnkxMDcxOTU1MTA=","name":"open-service-broker-azure","full_name":"Azure/open-service-broker-azure","owner":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/open-service-broker-azure","description":"The Open Service Broker API Server for Azure Services","fork":false,"url":"https://api.github.com/repos/Azure/open-service-broker-azure","forks_url":"https://api.github.com/repos/Azure/open-service-broker-azure/forks","keys_url":"https://api.github.com/repos/Azure/open-service-broker-azure/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/open-service-broker-azure/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/open-service-broker-azure/teams","hooks_url":"https://api.github.com/repos/Azure/open-service-broker-azure/hooks","issue_events_url":"https://api.github.com/repos/Azure/open-service-broker-azure/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/open-service-broker-azure/events","assignees_url":"https://api.github.com/repos/Azure/open-service-broker-azure/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/open-service-broker-azure/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/open-service-broker-azure/tags","blobs_url":"https://api.github.com/repos/Azure/open-service-broker-azure/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/open-service-broker-azure/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/open-service-broker-azure/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/open-service-broker-azure/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/open-service-broker-azure/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/open-service-broker-azure/languages","stargazers_url":"https://api.github.com/repos/Azure/open-service-broker-azure/stargazers","contributors_url":"https://api.github.com/repos/Azure/open-service-broker-azure/contributors","subscribers_url":"https://api.github.com/repos/Azure/open-service-broker-azure/subscribers","subscription_url":"https://api.github.com/repos/Azure/open-service-broker-azure/subscription","commits_url":"https://api.github.com/repos/Azure/open-service-broker-azure/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/open-service-broker-azure/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/open-service-broker-azure/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/open-service-broker-azure/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/open-service-broker-azure/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/open-service-broker-azure/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/open-service-broker-azure/merges","archive_url":"https://api.github.com/repos/Azure/open-service-broker-azure/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/open-service-broker-azure/downloads","issues_url":"https://api.github.com/repos/Azure/open-service-broker-azure/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/open-service-broker-azure/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/open-service-broker-azure/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/open-service-broker-azure/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/open-service-broker-azure/labels{/name}","releases_url":"https://api.github.com/repos/Azure/open-service-broker-azure/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/open-service-broker-azure/deployments","created_at":"2017-10-16T23:55:39Z","updated_at":"2018-08-10T05:30:35Z","pushed_at":"2018-08-14T02:53:00Z","git_url":"git://github.com/Azure/open-service-broker-azure.git","ssh_url":"git@github.com:Azure/open-service-broker-azure.git","clone_url":"https://github.com/Azure/open-service-broker-azure.git","svn_url":"https://github.com/Azure/open-service-broker-azure","homepage":"https://osba.sh","size":22302,"stargazers_count":102,"watchers_count":102,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":56,"mirror_url":null,"archived":false,"open_issues_count":89,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":56,"open_issues":89,"watchers":102,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/open-service-broker-azure/pulls/544"},"html":{"href":"https://github.com/Azure/open-service-broker-azure/pull/544"},"issue":{"href":"https://api.github.com/repos/Azure/open-service-broker-azure/issues/544"},"comments":{"href":"https://api.github.com/repos/Azure/open-service-broker-azure/issues/544/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/open-service-broker-azure/pulls/544/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/open-service-broker-azure/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/open-service-broker-azure/pulls/544/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/open-service-broker-azure/statuses/c4b81c5649a7f7eae9cd909b7b8f9c1ffed005d3"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"norshtein"}}