{"action":"opened","number":2517,"pull_request":{"url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/2517","id":122725756,"html_url":"https://github.com/greenplum-db/gpdb/pull/2517","diff_url":"https://github.com/greenplum-db/gpdb/pull/2517.diff","patch_url":"https://github.com/greenplum-db/gpdb/pull/2517.patch","issue_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/2517","number":2517,"state":"open","locked":false,"title":"Optimize DistributedSnapshot check and refactor to simplify.","user":{"login":"ashwinstar","id":11396815,"avatar_url":"https://avatars1.githubusercontent.com/u/11396815?v=3","gravatar_id":"","url":"https://api.github.com/users/ashwinstar","html_url":"https://github.com/ashwinstar","followers_url":"https://api.github.com/users/ashwinstar/followers","following_url":"https://api.github.com/users/ashwinstar/following{/other_user}","gists_url":"https://api.github.com/users/ashwinstar/gists{/gist_id}","starred_url":"https://api.github.com/users/ashwinstar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashwinstar/subscriptions","organizations_url":"https://api.github.com/users/ashwinstar/orgs","repos_url":"https://api.github.com/users/ashwinstar/repos","events_url":"https://api.github.com/users/ashwinstar/events{/privacy}","received_events_url":"https://api.github.com/users/ashwinstar/received_events","type":"User","site_admin":false},"body":"Before this commit, snapshot stored information of distributed in-progress\r\ntransactions populated during snapshot creation and its corresponding localXids\r\nfound during tuple visibility check later (used as cache) by reverse mapping\r\nusing single tightly coupled data structure DistributedSnapshotMapEntry. Storing\r\nthe information this way possed couple of problems:\r\n\r\n1] Only one localXid can be cached for a distributedXid. For sub-transactions\r\nsame distribXid can be associated with multiple localXid, but since can cache\r\nonly one, for other local xids associated with distributedXid need to consult\r\nthe distributed_log.\r\n\r\n2] While performing tuple visibility check, code must loop over full size of\r\ndistributed in-progress array always first to check if cached localXid can be\r\nutilized to avoid reverse mapping.\r\n\r\nNow, decoupled the distributed in-progress with local xids cache separately. So,\r\nthis allows us to store multiple xids per distributedXid. Also, allows to\r\noptimize scanning localXid only if tuple xid is relevant to it and also scanning\r\nsize only equivalent to number of elements cached instead of size of distributed\r\nin-progress always even if nothing was cached.\r\n\r\nAlong the way, refactored relevant code a bit as well to simplify further.","created_at":"2017-05-26T21:50:31Z","updated_at":"2017-05-26T21:50:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/2517/commits","review_comments_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/2517/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/2517/comments","statuses_url":"https://api.github.com/repos/greenplum-db/gpdb/statuses/0c5b5066875cd94e13a51d51d76a55e05df2c875","head":{"label":"ashwinstar:optimize_distributed_snapshot","ref":"optimize_distributed_snapshot","sha":"0c5b5066875cd94e13a51d51d76a55e05df2c875","user":{"login":"ashwinstar","id":11396815,"avatar_url":"https://avatars1.githubusercontent.com/u/11396815?v=3","gravatar_id":"","url":"https://api.github.com/users/ashwinstar","html_url":"https://github.com/ashwinstar","followers_url":"https://api.github.com/users/ashwinstar/followers","following_url":"https://api.github.com/users/ashwinstar/following{/other_user}","gists_url":"https://api.github.com/users/ashwinstar/gists{/gist_id}","starred_url":"https://api.github.com/users/ashwinstar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashwinstar/subscriptions","organizations_url":"https://api.github.com/users/ashwinstar/orgs","repos_url":"https://api.github.com/users/ashwinstar/repos","events_url":"https://api.github.com/users/ashwinstar/events{/privacy}","received_events_url":"https://api.github.com/users/ashwinstar/received_events","type":"User","site_admin":false},"repo":{"id":45129886,"name":"gpdb","full_name":"ashwinstar/gpdb","owner":{"login":"ashwinstar","id":11396815,"avatar_url":"https://avatars1.githubusercontent.com/u/11396815?v=3","gravatar_id":"","url":"https://api.github.com/users/ashwinstar","html_url":"https://github.com/ashwinstar","followers_url":"https://api.github.com/users/ashwinstar/followers","following_url":"https://api.github.com/users/ashwinstar/following{/other_user}","gists_url":"https://api.github.com/users/ashwinstar/gists{/gist_id}","starred_url":"https://api.github.com/users/ashwinstar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashwinstar/subscriptions","organizations_url":"https://api.github.com/users/ashwinstar/orgs","repos_url":"https://api.github.com/users/ashwinstar/repos","events_url":"https://api.github.com/users/ashwinstar/events{/privacy}","received_events_url":"https://api.github.com/users/ashwinstar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ashwinstar/gpdb","description":"Pivotal Greenplum Database","fork":true,"url":"https://api.github.com/repos/ashwinstar/gpdb","forks_url":"https://api.github.com/repos/ashwinstar/gpdb/forks","keys_url":"https://api.github.com/repos/ashwinstar/gpdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ashwinstar/gpdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ashwinstar/gpdb/teams","hooks_url":"https://api.github.com/repos/ashwinstar/gpdb/hooks","issue_events_url":"https://api.github.com/repos/ashwinstar/gpdb/issues/events{/number}","events_url":"https://api.github.com/repos/ashwinstar/gpdb/events","assignees_url":"https://api.github.com/repos/ashwinstar/gpdb/assignees{/user}","branches_url":"https://api.github.com/repos/ashwinstar/gpdb/branches{/branch}","tags_url":"https://api.github.com/repos/ashwinstar/gpdb/tags","blobs_url":"https://api.github.com/repos/ashwinstar/gpdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ashwinstar/gpdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ashwinstar/gpdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/ashwinstar/gpdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ashwinstar/gpdb/statuses/{sha}","languages_url":"https://api.github.com/repos/ashwinstar/gpdb/languages","stargazers_url":"https://api.github.com/repos/ashwinstar/gpdb/stargazers","contributors_url":"https://api.github.com/repos/ashwinstar/gpdb/contributors","subscribers_url":"https://api.github.com/repos/ashwinstar/gpdb/subscribers","subscription_url":"https://api.github.com/repos/ashwinstar/gpdb/subscription","commits_url":"https://api.github.com/repos/ashwinstar/gpdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/ashwinstar/gpdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/ashwinstar/gpdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/ashwinstar/gpdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/ashwinstar/gpdb/contents/{+path}","compare_url":"https://api.github.com/repos/ashwinstar/gpdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ashwinstar/gpdb/merges","archive_url":"https://api.github.com/repos/ashwinstar/gpdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ashwinstar/gpdb/downloads","issues_url":"https://api.github.com/repos/ashwinstar/gpdb/issues{/number}","pulls_url":"https://api.github.com/repos/ashwinstar/gpdb/pulls{/number}","milestones_url":"https://api.github.com/repos/ashwinstar/gpdb/milestones{/number}","notifications_url":"https://api.github.com/repos/ashwinstar/gpdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ashwinstar/gpdb/labels{/name}","releases_url":"https://api.github.com/repos/ashwinstar/gpdb/releases{/id}","deployments_url":"https://api.github.com/repos/ashwinstar/gpdb/deployments","created_at":"2015-10-28T17:27:21Z","updated_at":"2016-02-02T21:35:16Z","pushed_at":"2017-05-26T21:49:53Z","git_url":"git://github.com/ashwinstar/gpdb.git","ssh_url":"git@github.com:ashwinstar/gpdb.git","clone_url":"https://github.com/ashwinstar/gpdb.git","svn_url":"https://github.com/ashwinstar/gpdb","homepage":"http://greenplum.org","size":212775,"stargazers_count":0,"watchers_count":0,"language":"PLpgSQL","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"greenplum-db:master","ref":"master","sha":"c4f26133445035572397de1506c72c982c499c35","user":{"login":"greenplum-db","id":14097842,"avatar_url":"https://avatars1.githubusercontent.com/u/14097842?v=3","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://avatars1.githubusercontent.com/u/14097842?v=3","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-05-26T08:02:57Z","pushed_at":"2017-05-26T21:47:41Z","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":212608,"stargazers_count":1939,"watchers_count":1939,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":590,"mirror_url":null,"open_issues_count":131,"forks":590,"open_issues":131,"watchers":1939,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/2517"},"html":{"href":"https://github.com/greenplum-db/gpdb/pull/2517"},"issue":{"href":"https://api.github.com/repos/greenplum-db/gpdb/issues/2517"},"comments":{"href":"https://api.github.com/repos/greenplum-db/gpdb/issues/2517/comments"},"review_comments":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/2517/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/2517/commits"},"statuses":{"href":"https://api.github.com/repos/greenplum-db/gpdb/statuses/0c5b5066875cd94e13a51d51d76a55e05df2c875"}},"merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":655,"deletions":484,"changed_files":15}}
{"actor":{"display_login":"ashwinstar"}}