{"action":"created","comment":{"url":"https://api.github.com/repos/greenplum-db/gpupgrade/pulls/comments/195875945","pull_request_review_id":129333923,"id":195875945,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTg3NTk0NQ==","diff_hunk":"@@ -1,35 +1,79 @@\n package services\n \n import (\n+\t\"fmt\"\n+\n+\t\"github.com/greenplum-db/gpupgrade/hub/upgradestatus\"\n \tpb \"github.com/greenplum-db/gpupgrade/idl\"\n \n \t\"golang.org/x/net/context\"\n \n-\t\"path\"\n-\n+\t\"github.com/greenplum-db/gp-common-go-libs/cluster\"\n \t\"github.com/greenplum-db/gp-common-go-libs/gplog\"\n )\n \n func (h *Hub) PrepareShutdownClusters(ctx context.Context, in *pb.PrepareShutdownClustersRequest) (*pb.PrepareShutdownClustersReply, error) {\n \tgplog.Info(\"starting PrepareShutdownClusters()\")\n \n-\t// will be initialized for future uses also? We think so -- it should\n-\toldPostmasterRunning, newPostmasterRunning := h.clusterPair.EitherPostmasterRunning()\n-\tif oldPostmasterRunning || newPostmasterRunning {\n-\t\tpathToGpstopStateDir := path.Join(h.conf.StateDir, \"gpstop\")\n-\t\tgo h.clusterPair.StopEverything(pathToGpstopStateDir, oldPostmasterRunning, newPostmasterRunning)\n-\t} else {\n-\t\tgplog.Info(\"PrepareShutdownClusters: neither postmaster was running, nothing to do\")\n+\tgo h.ShutdownClusters()","path":"hub/services/hub_prepare_shutdown_clusters.go","position":27,"original_position":27,"commit_id":"d68ab972319da1c2af330e11414e25baaf982802","original_commit_id":"d68ab972319da1c2af330e11414e25baaf982802","user":{"login":"slari-pivotal","id":14188626,"node_id":"MDQ6VXNlcjE0MTg4NjI2","avatar_url":"https://avatars3.githubusercontent.com/u/14188626?v=4","gravatar_id":"","url":"https://api.github.com/users/slari-pivotal","html_url":"https://github.com/slari-pivotal","followers_url":"https://api.github.com/users/slari-pivotal/followers","following_url":"https://api.github.com/users/slari-pivotal/following{/other_user}","gists_url":"https://api.github.com/users/slari-pivotal/gists{/gist_id}","starred_url":"https://api.github.com/users/slari-pivotal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slari-pivotal/subscriptions","organizations_url":"https://api.github.com/users/slari-pivotal/orgs","repos_url":"https://api.github.com/users/slari-pivotal/repos","events_url":"https://api.github.com/users/slari-pivotal/events{/privacy}","received_events_url":"https://api.github.com/users/slari-pivotal/received_events","type":"User","site_admin":false},"body":"Right now, the only thing ending goroutines is the process ending, and it's difficult to ensure they end in our current model.  A follow-up discussion would be good.","created_at":"2018-06-15T22:28:06Z","updated_at":"2018-06-15T22:28:06Z","html_url":"https://github.com/greenplum-db/gpupgrade/pull/10#discussion_r195875945","pull_request_url":"https://api.github.com/repos/greenplum-db/gpupgrade/pulls/10","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/greenplum-db/gpupgrade/pulls/comments/195875945"},"html":{"href":"https://github.com/greenplum-db/gpupgrade/pull/10#discussion_r195875945"},"pull_request":{"href":"https://api.github.com/repos/greenplum-db/gpupgrade/pulls/10"}},"in_reply_to_id":195593978},"pull_request":{"url":"https://api.github.com/repos/greenplum-db/gpupgrade/pulls/10","id":195031659,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MDMxNjU5","html_url":"https://github.com/greenplum-db/gpupgrade/pull/10","diff_url":"https://github.com/greenplum-db/gpupgrade/pull/10.diff","patch_url":"https://github.com/greenplum-db/gpupgrade/pull/10.patch","issue_url":"https://api.github.com/repos/greenplum-db/gpupgrade/issues/10","number":10,"state":"open","locked":false,"title":"Refactor tests to use MockChecklistManager","user":{"login":"slari-pivotal","id":14188626,"node_id":"MDQ6VXNlcjE0MTg4NjI2","avatar_url":"https://avatars3.githubusercontent.com/u/14188626?v=4","gravatar_id":"","url":"https://api.github.com/users/slari-pivotal","html_url":"https://github.com/slari-pivotal","followers_url":"https://api.github.com/users/slari-pivotal/followers","following_url":"https://api.github.com/users/slari-pivotal/following{/other_user}","gists_url":"https://api.github.com/users/slari-pivotal/gists{/gist_id}","starred_url":"https://api.github.com/users/slari-pivotal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slari-pivotal/subscriptions","organizations_url":"https://api.github.com/users/slari-pivotal/orgs","repos_url":"https://api.github.com/users/slari-pivotal/repos","events_url":"https://api.github.com/users/slari-pivotal/events{/privacy}","received_events_url":"https://api.github.com/users/slari-pivotal/received_events","type":"User","site_admin":false},"body":"Previously, our tests were checking the status of individual steps by\r\ncalling out to status upgrade in the CLI, which required a lot of\r\nmocking and made some tests flaky.  This commit refactors the tests to\r\nuse a MockChecklistManager, which simplifies the testing and reduces the\r\ntest time.\r\n\r\nAdditionally, the hub was refactored to take a ChecklistWriter\r\nseparately from the one in its RemoteExecutor, and several functions\r\nwere moved from the ClusterPair object to the Hub, in preparation for a\r\nlater refactor of ClusterSsher.\r\n\r\nFinally, checks were added to the status upgrade step to not attempt to\r\ngather status information for steps that could not have been run yet if\r\ncheck config or prepare start-agents were not yet run, and the tests\r\nwere modified accordingly.\r\n\r\nCo-authored-by: Kevin Yeap <kyeap@pivotal.io>\r\nCo-authored-by: Jamie McAtamney <jmcatamney@pivotal.io>\r\nCo-authored-by: Jim Doty <jdoty@pivotal.io>\r\nCo-authored-by: Shoaib Lari <slari@pivotal.io>","created_at":"2018-06-14T22:10:31Z","updated_at":"2018-06-15T22:28:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ec4622f3991e421e021e8ed0c4d5aadc5722ee2","assignee":null,"assignees":[],"requested_reviewers":[{"login":"nadeemg","id":6484469,"node_id":"MDQ6VXNlcjY0ODQ0Njk=","avatar_url":"https://avatars3.githubusercontent.com/u/6484469?v=4","gravatar_id":"","url":"https://api.github.com/users/nadeemg","html_url":"https://github.com/nadeemg","followers_url":"https://api.github.com/users/nadeemg/followers","following_url":"https://api.github.com/users/nadeemg/following{/other_user}","gists_url":"https://api.github.com/users/nadeemg/gists{/gist_id}","starred_url":"https://api.github.com/users/nadeemg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nadeemg/subscriptions","organizations_url":"https://api.github.com/users/nadeemg/orgs","repos_url":"https://api.github.com/users/nadeemg/repos","events_url":"https://api.github.com/users/nadeemg/events{/privacy}","received_events_url":"https://api.github.com/users/nadeemg/received_events","type":"User","site_admin":false},{"login":"kyeap-pivotal","id":36176870,"node_id":"MDQ6VXNlcjM2MTc2ODcw","avatar_url":"https://avatars0.githubusercontent.com/u/36176870?v=4","gravatar_id":"","url":"https://api.github.com/users/kyeap-pivotal","html_url":"https://github.com/kyeap-pivotal","followers_url":"https://api.github.com/users/kyeap-pivotal/followers","following_url":"https://api.github.com/users/kyeap-pivotal/following{/other_user}","gists_url":"https://api.github.com/users/kyeap-pivotal/gists{/gist_id}","starred_url":"https://api.github.com/users/kyeap-pivotal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyeap-pivotal/subscriptions","organizations_url":"https://api.github.com/users/kyeap-pivotal/orgs","repos_url":"https://api.github.com/users/kyeap-pivotal/repos","events_url":"https://api.github.com/users/kyeap-pivotal/events{/privacy}","received_events_url":"https://api.github.com/users/kyeap-pivotal/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/greenplum-db/gpupgrade/pulls/10/commits","review_comments_url":"https://api.github.com/repos/greenplum-db/gpupgrade/pulls/10/comments","review_comment_url":"https://api.github.com/repos/greenplum-db/gpupgrade/pulls/comments{/number}","comments_url":"https://api.github.com/repos/greenplum-db/gpupgrade/issues/10/comments","statuses_url":"https://api.github.com/repos/greenplum-db/gpupgrade/statuses/d68ab972319da1c2af330e11414e25baaf982802","head":{"label":"greenplum-db:158168715-refactor-checklistmanager","ref":"158168715-refactor-checklistmanager","sha":"d68ab972319da1c2af330e11414e25baaf982802","user":{"login":"greenplum-db","id":14097842,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MDk3ODQy","avatar_url":"https://avatars2.githubusercontent.com/u/14097842?v=4","gravatar_id":"","url":"https://api.github.com/users/greenplum-db","html_url":"https://github.com/greenplum-db","followers_url":"https://api.github.com/users/greenplum-db/followers","following_url":"https://api.github.com/users/greenplum-db/following{/other_user}","gists_url":"https://api.github.com/users/greenplum-db/gists{/gist_id}","starred_url":"https://api.github.com/users/greenplum-db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenplum-db/subscriptions","organizations_url":"https://api.github.com/users/greenplum-db/orgs","repos_url":"https://api.github.com/users/greenplum-db/repos","events_url":"https://api.github.com/users/greenplum-db/events{/privacy}","received_events_url":"https://api.github.com/users/greenplum-db/received_events","type":"Organization","site_admin":false},"repo":{"id":128096570,"node_id":"MDEwOlJlcG9zaXRvcnkxMjgwOTY1NzA=","name":"gpupgrade","full_name":"greenplum-db/gpupgrade","owner":{"login":"greenplum-db","id":14097842,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MDk3ODQy","avatar_url":"https://avatars2.githubusercontent.com/u/14097842?v=4","gravatar_id":"","url":"https://api.github.com/users/greenplum-db","html_url":"https://github.com/greenplum-db","followers_url":"https://api.github.com/users/greenplum-db/followers","following_url":"https://api.github.com/users/greenplum-db/following{/other_user}","gists_url":"https://api.github.com/users/greenplum-db/gists{/gist_id}","starred_url":"https://api.github.com/users/greenplum-db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenplum-db/subscriptions","organizations_url":"https://api.github.com/users/greenplum-db/orgs","repos_url":"https://api.github.com/users/greenplum-db/repos","events_url":"https://api.github.com/users/greenplum-db/events{/privacy}","received_events_url":"https://api.github.com/users/greenplum-db/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/greenplum-db/gpupgrade","description":"GPDB Upgrade Utility called gpupgrade","fork":false,"url":"https://api.github.com/repos/greenplum-db/gpupgrade","forks_url":"https://api.github.com/repos/greenplum-db/gpupgrade/forks","keys_url":"https://api.github.com/repos/greenplum-db/gpupgrade/keys{/key_id}","collaborators_url":"https://api.github.com/repos/greenplum-db/gpupgrade/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/greenplum-db/gpupgrade/teams","hooks_url":"https://api.github.com/repos/greenplum-db/gpupgrade/hooks","issue_events_url":"https://api.github.com/repos/greenplum-db/gpupgrade/issues/events{/number}","events_url":"https://api.github.com/repos/greenplum-db/gpupgrade/events","assignees_url":"https://api.github.com/repos/greenplum-db/gpupgrade/assignees{/user}","branches_url":"https://api.github.com/repos/greenplum-db/gpupgrade/branches{/branch}","tags_url":"https://api.github.com/repos/greenplum-db/gpupgrade/tags","blobs_url":"https://api.github.com/repos/greenplum-db/gpupgrade/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/greenplum-db/gpupgrade/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/greenplum-db/gpupgrade/git/refs{/sha}","trees_url":"https://api.github.com/repos/greenplum-db/gpupgrade/git/trees{/sha}","statuses_url":"https://api.github.com/repos/greenplum-db/gpupgrade/statuses/{sha}","languages_url":"https://api.github.com/repos/greenplum-db/gpupgrade/languages","stargazers_url":"https://api.github.com/repos/greenplum-db/gpupgrade/stargazers","contributors_url":"https://api.github.com/repos/greenplum-db/gpupgrade/contributors","subscribers_url":"https://api.github.com/repos/greenplum-db/gpupgrade/subscribers","subscription_url":"https://api.github.com/repos/greenplum-db/gpupgrade/subscription","commits_url":"https://api.github.com/repos/greenplum-db/gpupgrade/commits{/sha}","git_commits_url":"https://api.github.com/repos/greenplum-db/gpupgrade/git/commits{/sha}","comments_url":"https://api.github.com/repos/greenplum-db/gpupgrade/comments{/number}","issue_comment_url":"https://api.github.com/repos/greenplum-db/gpupgrade/issues/comments{/number}","contents_url":"https://api.github.com/repos/greenplum-db/gpupgrade/contents/{+path}","compare_url":"https://api.github.com/repos/greenplum-db/gpupgrade/compare/{base}...{head}","merges_url":"https://api.github.com/repos/greenplum-db/gpupgrade/merges","archive_url":"https://api.github.com/repos/greenplum-db/gpupgrade/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/greenplum-db/gpupgrade/downloads","issues_url":"https://api.github.com/repos/greenplum-db/gpupgrade/issues{/number}","pulls_url":"https://api.github.com/repos/greenplum-db/gpupgrade/pulls{/number}","milestones_url":"https://api.github.com/repos/greenplum-db/gpupgrade/milestones{/number}","notifications_url":"https://api.github.com/repos/greenplum-db/gpupgrade/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/greenplum-db/gpupgrade/labels{/name}","releases_url":"https://api.github.com/repos/greenplum-db/gpupgrade/releases{/id}","deployments_url":"https://api.github.com/repos/greenplum-db/gpupgrade/deployments","created_at":"2018-04-04T17:26:51Z","updated_at":"2018-06-11T16:29:57Z","pushed_at":"2018-06-15T21:46:06Z","git_url":"git://github.com/greenplum-db/gpupgrade.git","ssh_url":"git@github.com:greenplum-db/gpupgrade.git","clone_url":"https://github.com/greenplum-db/gpupgrade.git","svn_url":"https://github.com/greenplum-db/gpupgrade","homepage":null,"size":951,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":3,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"greenplum-db:master","ref":"master","sha":"7eae21ab28f66cf3fa5652a707bbff526570335a","user":{"login":"greenplum-db","id":14097842,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MDk3ODQy","avatar_url":"https://avatars2.githubusercontent.com/u/14097842?v=4","gravatar_id":"","url":"https://api.github.com/users/greenplum-db","html_url":"https://github.com/greenplum-db","followers_url":"https://api.github.com/users/greenplum-db/followers","following_url":"https://api.github.com/users/greenplum-db/following{/other_user}","gists_url":"https://api.github.com/users/greenplum-db/gists{/gist_id}","starred_url":"https://api.github.com/users/greenplum-db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenplum-db/subscriptions","organizations_url":"https://api.github.com/users/greenplum-db/orgs","repos_url":"https://api.github.com/users/greenplum-db/repos","events_url":"https://api.github.com/users/greenplum-db/events{/privacy}","received_events_url":"https://api.github.com/users/greenplum-db/received_events","type":"Organization","site_admin":false},"repo":{"id":128096570,"node_id":"MDEwOlJlcG9zaXRvcnkxMjgwOTY1NzA=","name":"gpupgrade","full_name":"greenplum-db/gpupgrade","owner":{"login":"greenplum-db","id":14097842,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MDk3ODQy","avatar_url":"https://avatars2.githubusercontent.com/u/14097842?v=4","gravatar_id":"","url":"https://api.github.com/users/greenplum-db","html_url":"https://github.com/greenplum-db","followers_url":"https://api.github.com/users/greenplum-db/followers","following_url":"https://api.github.com/users/greenplum-db/following{/other_user}","gists_url":"https://api.github.com/users/greenplum-db/gists{/gist_id}","starred_url":"https://api.github.com/users/greenplum-db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenplum-db/subscriptions","organizations_url":"https://api.github.com/users/greenplum-db/orgs","repos_url":"https://api.github.com/users/greenplum-db/repos","events_url":"https://api.github.com/users/greenplum-db/events{/privacy}","received_events_url":"https://api.github.com/users/greenplum-db/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/greenplum-db/gpupgrade","description":"GPDB Upgrade Utility called gpupgrade","fork":false,"url":"https://api.github.com/repos/greenplum-db/gpupgrade","forks_url":"https://api.github.com/repos/greenplum-db/gpupgrade/forks","keys_url":"https://api.github.com/repos/greenplum-db/gpupgrade/keys{/key_id}","collaborators_url":"https://api.github.com/repos/greenplum-db/gpupgrade/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/greenplum-db/gpupgrade/teams","hooks_url":"https://api.github.com/repos/greenplum-db/gpupgrade/hooks","issue_events_url":"https://api.github.com/repos/greenplum-db/gpupgrade/issues/events{/number}","events_url":"https://api.github.com/repos/greenplum-db/gpupgrade/events","assignees_url":"https://api.github.com/repos/greenplum-db/gpupgrade/assignees{/user}","branches_url":"https://api.github.com/repos/greenplum-db/gpupgrade/branches{/branch}","tags_url":"https://api.github.com/repos/greenplum-db/gpupgrade/tags","blobs_url":"https://api.github.com/repos/greenplum-db/gpupgrade/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/greenplum-db/gpupgrade/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/greenplum-db/gpupgrade/git/refs{/sha}","trees_url":"https://api.github.com/repos/greenplum-db/gpupgrade/git/trees{/sha}","statuses_url":"https://api.github.com/repos/greenplum-db/gpupgrade/statuses/{sha}","languages_url":"https://api.github.com/repos/greenplum-db/gpupgrade/languages","stargazers_url":"https://api.github.com/repos/greenplum-db/gpupgrade/stargazers","contributors_url":"https://api.github.com/repos/greenplum-db/gpupgrade/contributors","subscribers_url":"https://api.github.com/repos/greenplum-db/gpupgrade/subscribers","subscription_url":"https://api.github.com/repos/greenplum-db/gpupgrade/subscription","commits_url":"https://api.github.com/repos/greenplum-db/gpupgrade/commits{/sha}","git_commits_url":"https://api.github.com/repos/greenplum-db/gpupgrade/git/commits{/sha}","comments_url":"https://api.github.com/repos/greenplum-db/gpupgrade/comments{/number}","issue_comment_url":"https://api.github.com/repos/greenplum-db/gpupgrade/issues/comments{/number}","contents_url":"https://api.github.com/repos/greenplum-db/gpupgrade/contents/{+path}","compare_url":"https://api.github.com/repos/greenplum-db/gpupgrade/compare/{base}...{head}","merges_url":"https://api.github.com/repos/greenplum-db/gpupgrade/merges","archive_url":"https://api.github.com/repos/greenplum-db/gpupgrade/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/greenplum-db/gpupgrade/downloads","issues_url":"https://api.github.com/repos/greenplum-db/gpupgrade/issues{/number}","pulls_url":"https://api.github.com/repos/greenplum-db/gpupgrade/pulls{/number}","milestones_url":"https://api.github.com/repos/greenplum-db/gpupgrade/milestones{/number}","notifications_url":"https://api.github.com/repos/greenplum-db/gpupgrade/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/greenplum-db/gpupgrade/labels{/name}","releases_url":"https://api.github.com/repos/greenplum-db/gpupgrade/releases{/id}","deployments_url":"https://api.github.com/repos/greenplum-db/gpupgrade/deployments","created_at":"2018-04-04T17:26:51Z","updated_at":"2018-06-11T16:29:57Z","pushed_at":"2018-06-15T21:46:06Z","git_url":"git://github.com/greenplum-db/gpupgrade.git","ssh_url":"git@github.com:greenplum-db/gpupgrade.git","clone_url":"https://github.com/greenplum-db/gpupgrade.git","svn_url":"https://github.com/greenplum-db/gpupgrade","homepage":null,"size":951,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":3,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/greenplum-db/gpupgrade/pulls/10"},"html":{"href":"https://github.com/greenplum-db/gpupgrade/pull/10"},"issue":{"href":"https://api.github.com/repos/greenplum-db/gpupgrade/issues/10"},"comments":{"href":"https://api.github.com/repos/greenplum-db/gpupgrade/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/greenplum-db/gpupgrade/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/greenplum-db/gpupgrade/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/greenplum-db/gpupgrade/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/greenplum-db/gpupgrade/statuses/d68ab972319da1c2af330e11414e25baaf982802"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"slari-pivotal"}}