{"action":"created","comment":{"url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/comments/155386690","pull_request_review_id":81698035,"id":155386690,"diff_hunk":"@@ -368,11 +374,54 @@ def defargs():\n                         help='Master port to get segment config information from')\n     parser.add_argument('--database', type=str, required=False, default='postgres',\n                         help='Database name to get segment config information from')\n-    parser.add_argument('operation', type=str, choices=['init', 'clusterstart', 'start', 'stop', 'destroy'])\n+    parser.add_argument('operation', type=str, choices=['clusterstart', 'clusterstop', 'init', 'start', 'stop', 'destroy', 'recover'])\n \n     return parser.parse_args()\n \n-def ForceFTSProbeScan(cluster_configuration, expected_mirror_status = None, expected_mirror_mode = None, max_probes=2000):\n+def GetNumberOfSegments(input_segments):\n+    if len(input_segments) > 0:\n+        return len(input_segments.split(','))\n+    return 0\n+\n+def WaitForRecover(cluster_configuration, max_retries = 200):\n+    '''Wait for the gp_stat_replication to reach given sync_error'''\n+\n+    cmd_all_sync = \"psql postgres -A -R ',' -t -c \\\"SELECT gp_segment_id FROM gp_stat_replication\" \\\n+            \" WHERE gp_segment_id in (%s) and coalesce(sync_state, 'NULL') = 'sync'\\\"\" % \\\n+                   cluster_configuration.get_gp_segment_ids()\n+\n+    cmd_find_error = \"psql postgres -A -R ',' -t -c \\\"SELECT gp_segment_id FROM gp_stat_replication\" \\\n+                   \" WHERE gp_segment_id in (%s) and sync_error != 'none'\\\"\" % cluster_configuration.get_gp_segment_ids()\n+\n+    number_of_segments = len(cluster_configuration.seg_configs)\n+\n+    print \"cmd_all_sync: %s\" % cmd_all_sync","path":"gpAux/gpdemo/gpsegwalrep.py","position":212,"original_position":212,"commit_id":"9c1c1235d6e7757b987d62c7581a73c89534fc85","original_commit_id":"fb74dd7d93465fc82928d28c47fbf69c2a1018c3","user":{"login":"xinzweb","id":723898,"avatar_url":"https://avatars1.githubusercontent.com/u/723898?v=4","gravatar_id":"","url":"https://api.github.com/users/xinzweb","html_url":"https://github.com/xinzweb","followers_url":"https://api.github.com/users/xinzweb/followers","following_url":"https://api.github.com/users/xinzweb/following{/other_user}","gists_url":"https://api.github.com/users/xinzweb/gists{/gist_id}","starred_url":"https://api.github.com/users/xinzweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xinzweb/subscriptions","organizations_url":"https://api.github.com/users/xinzweb/orgs","repos_url":"https://api.github.com/users/xinzweb/repos","events_url":"https://api.github.com/users/xinzweb/events{/privacy}","received_events_url":"https://api.github.com/users/xinzweb/received_events","type":"User","site_admin":false},"body":"Thanks a lot. Fixed.","created_at":"2017-12-06T22:58:09Z","updated_at":"2017-12-06T22:58:09Z","html_url":"https://github.com/greenplum-db/gpdb/pull/4059#discussion_r155386690","pull_request_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/4059","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/comments/155386690"},"html":{"href":"https://github.com/greenplum-db/gpdb/pull/4059#discussion_r155386690"},"pull_request":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/4059"}},"in_reply_to_id":155338191},"pull_request":{"url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/4059","id":156623519,"html_url":"https://github.com/greenplum-db/gpdb/pull/4059","diff_url":"https://github.com/greenplum-db/gpdb/pull/4059.diff","patch_url":"https://github.com/greenplum-db/gpdb/pull/4059.patch","issue_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/4059","number":4059,"state":"open","locked":false,"title":"Add `recover` operation to `gpsegwalrep.py`","user":{"login":"xinzweb","id":723898,"avatar_url":"https://avatars1.githubusercontent.com/u/723898?v=4","gravatar_id":"","url":"https://api.github.com/users/xinzweb","html_url":"https://github.com/xinzweb","followers_url":"https://api.github.com/users/xinzweb/followers","following_url":"https://api.github.com/users/xinzweb/following{/other_user}","gists_url":"https://api.github.com/users/xinzweb/gists{/gist_id}","starred_url":"https://api.github.com/users/xinzweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xinzweb/subscriptions","organizations_url":"https://api.github.com/users/xinzweb/orgs","repos_url":"https://api.github.com/users/xinzweb/repos","events_url":"https://api.github.com/users/xinzweb/events{/privacy}","received_events_url":"https://api.github.com/users/xinzweb/received_events","type":"User","site_admin":false},"body":"- It can perform incremental recovery\r\n- It can report failed segments if the incremental recovery failed\r\n- `gp_stat_replication` view is extended to display the reason of sync_error\r\n\r\nAlso some minor refactoring of 'fsync=off` by default etc.","created_at":"2017-12-06T02:09:56Z","updated_at":"2017-12-06T22:58:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3c4357f5af16f68604a1de638d18dffa01e8c878","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/4059/commits","review_comments_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/4059/comments","review_comment_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/4059/comments","statuses_url":"https://api.github.com/repos/greenplum-db/gpdb/statuses/9c1c1235d6e7757b987d62c7581a73c89534fc85","head":{"label":"xinzweb:147688033_recover","ref":"147688033_recover","sha":"9c1c1235d6e7757b987d62c7581a73c89534fc85","user":{"login":"xinzweb","id":723898,"avatar_url":"https://avatars1.githubusercontent.com/u/723898?v=4","gravatar_id":"","url":"https://api.github.com/users/xinzweb","html_url":"https://github.com/xinzweb","followers_url":"https://api.github.com/users/xinzweb/followers","following_url":"https://api.github.com/users/xinzweb/following{/other_user}","gists_url":"https://api.github.com/users/xinzweb/gists{/gist_id}","starred_url":"https://api.github.com/users/xinzweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xinzweb/subscriptions","organizations_url":"https://api.github.com/users/xinzweb/orgs","repos_url":"https://api.github.com/users/xinzweb/repos","events_url":"https://api.github.com/users/xinzweb/events{/privacy}","received_events_url":"https://api.github.com/users/xinzweb/received_events","type":"User","site_admin":false},"repo":{"id":45497539,"name":"gpdb","full_name":"xinzweb/gpdb","owner":{"login":"xinzweb","id":723898,"avatar_url":"https://avatars1.githubusercontent.com/u/723898?v=4","gravatar_id":"","url":"https://api.github.com/users/xinzweb","html_url":"https://github.com/xinzweb","followers_url":"https://api.github.com/users/xinzweb/followers","following_url":"https://api.github.com/users/xinzweb/following{/other_user}","gists_url":"https://api.github.com/users/xinzweb/gists{/gist_id}","starred_url":"https://api.github.com/users/xinzweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xinzweb/subscriptions","organizations_url":"https://api.github.com/users/xinzweb/orgs","repos_url":"https://api.github.com/users/xinzweb/repos","events_url":"https://api.github.com/users/xinzweb/events{/privacy}","received_events_url":"https://api.github.com/users/xinzweb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xinzweb/gpdb","description":"Pivotal Greenplum Database","fork":true,"url":"https://api.github.com/repos/xinzweb/gpdb","forks_url":"https://api.github.com/repos/xinzweb/gpdb/forks","keys_url":"https://api.github.com/repos/xinzweb/gpdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xinzweb/gpdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xinzweb/gpdb/teams","hooks_url":"https://api.github.com/repos/xinzweb/gpdb/hooks","issue_events_url":"https://api.github.com/repos/xinzweb/gpdb/issues/events{/number}","events_url":"https://api.github.com/repos/xinzweb/gpdb/events","assignees_url":"https://api.github.com/repos/xinzweb/gpdb/assignees{/user}","branches_url":"https://api.github.com/repos/xinzweb/gpdb/branches{/branch}","tags_url":"https://api.github.com/repos/xinzweb/gpdb/tags","blobs_url":"https://api.github.com/repos/xinzweb/gpdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xinzweb/gpdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xinzweb/gpdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/xinzweb/gpdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xinzweb/gpdb/statuses/{sha}","languages_url":"https://api.github.com/repos/xinzweb/gpdb/languages","stargazers_url":"https://api.github.com/repos/xinzweb/gpdb/stargazers","contributors_url":"https://api.github.com/repos/xinzweb/gpdb/contributors","subscribers_url":"https://api.github.com/repos/xinzweb/gpdb/subscribers","subscription_url":"https://api.github.com/repos/xinzweb/gpdb/subscription","commits_url":"https://api.github.com/repos/xinzweb/gpdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/xinzweb/gpdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/xinzweb/gpdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/xinzweb/gpdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/xinzweb/gpdb/contents/{+path}","compare_url":"https://api.github.com/repos/xinzweb/gpdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xinzweb/gpdb/merges","archive_url":"https://api.github.com/repos/xinzweb/gpdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xinzweb/gpdb/downloads","issues_url":"https://api.github.com/repos/xinzweb/gpdb/issues{/number}","pulls_url":"https://api.github.com/repos/xinzweb/gpdb/pulls{/number}","milestones_url":"https://api.github.com/repos/xinzweb/gpdb/milestones{/number}","notifications_url":"https://api.github.com/repos/xinzweb/gpdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xinzweb/gpdb/labels{/name}","releases_url":"https://api.github.com/repos/xinzweb/gpdb/releases{/id}","deployments_url":"https://api.github.com/repos/xinzweb/gpdb/deployments","created_at":"2015-11-03T21:41:51Z","updated_at":"2017-01-25T01:33:25Z","pushed_at":"2017-12-06T22:20:25Z","git_url":"git://github.com/xinzweb/gpdb.git","ssh_url":"git@github.com:xinzweb/gpdb.git","clone_url":"https://github.com/xinzweb/gpdb.git","svn_url":"https://github.com/xinzweb/gpdb","homepage":"http://greenplum.org","size":239735,"stargazers_count":0,"watchers_count":0,"language":"C","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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"greenplum-db:master","ref":"master","sha":"10d8eebd75a40e0884ef37e442472311320b0cee","user":{"login":"greenplum-db","id":14097842,"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":44781140,"name":"gpdb","full_name":"greenplum-db/gpdb","owner":{"login":"greenplum-db","id":14097842,"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/gpdb","description":"Greenplum Database","fork":false,"url":"https://api.github.com/repos/greenplum-db/gpdb","forks_url":"https://api.github.com/repos/greenplum-db/gpdb/forks","keys_url":"https://api.github.com/repos/greenplum-db/gpdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/greenplum-db/gpdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/greenplum-db/gpdb/teams","hooks_url":"https://api.github.com/repos/greenplum-db/gpdb/hooks","issue_events_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/events{/number}","events_url":"https://api.github.com/repos/greenplum-db/gpdb/events","assignees_url":"https://api.github.com/repos/greenplum-db/gpdb/assignees{/user}","branches_url":"https://api.github.com/repos/greenplum-db/gpdb/branches{/branch}","tags_url":"https://api.github.com/repos/greenplum-db/gpdb/tags","blobs_url":"https://api.github.com/repos/greenplum-db/gpdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/greenplum-db/gpdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/greenplum-db/gpdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/greenplum-db/gpdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/greenplum-db/gpdb/statuses/{sha}","languages_url":"https://api.github.com/repos/greenplum-db/gpdb/languages","stargazers_url":"https://api.github.com/repos/greenplum-db/gpdb/stargazers","contributors_url":"https://api.github.com/repos/greenplum-db/gpdb/contributors","subscribers_url":"https://api.github.com/repos/greenplum-db/gpdb/subscribers","subscription_url":"https://api.github.com/repos/greenplum-db/gpdb/subscription","commits_url":"https://api.github.com/repos/greenplum-db/gpdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/greenplum-db/gpdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/greenplum-db/gpdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/greenplum-db/gpdb/contents/{+path}","compare_url":"https://api.github.com/repos/greenplum-db/gpdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/greenplum-db/gpdb/merges","archive_url":"https://api.github.com/repos/greenplum-db/gpdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/greenplum-db/gpdb/downloads","issues_url":"https://api.github.com/repos/greenplum-db/gpdb/issues{/number}","pulls_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls{/number}","milestones_url":"https://api.github.com/repos/greenplum-db/gpdb/milestones{/number}","notifications_url":"https://api.github.com/repos/greenplum-db/gpdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/greenplum-db/gpdb/labels{/name}","releases_url":"https://api.github.com/repos/greenplum-db/gpdb/releases{/id}","deployments_url":"https://api.github.com/repos/greenplum-db/gpdb/deployments","created_at":"2015-10-23T00:25:17Z","updated_at":"2017-12-06T21:20:27Z","pushed_at":"2017-12-06T22:45:38Z","git_url":"git://github.com/greenplum-db/gpdb.git","ssh_url":"git@github.com:greenplum-db/gpdb.git","clone_url":"https://github.com/greenplum-db/gpdb.git","svn_url":"https://github.com/greenplum-db/gpdb","homepage":"http://greenplum.org","size":242158,"stargazers_count":2204,"watchers_count":2204,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":694,"mirror_url":null,"archived":false,"open_issues_count":198,"license":null,"forks":694,"open_issues":198,"watchers":2204,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/4059"},"html":{"href":"https://github.com/greenplum-db/gpdb/pull/4059"},"issue":{"href":"https://api.github.com/repos/greenplum-db/gpdb/issues/4059"},"comments":{"href":"https://api.github.com/repos/greenplum-db/gpdb/issues/4059/comments"},"review_comments":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/4059/comments"},"review_comment":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/4059/commits"},"statuses":{"href":"https://api.github.com/repos/greenplum-db/gpdb/statuses/9c1c1235d6e7757b987d62c7581a73c89534fc85"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"xinzweb"}}