{"action":"created","comment":{"url":"https://api.github.com/repos/apache/couchdb/pulls/comments/173858455","pull_request_review_id":103116697,"id":173858455,"diff_hunk":"@@ -58,6 +58,7 @@ start(#st{} = St, DbName, Options, Parent) ->\n     NewSt3 = sort_meta_data(NewSt2),\n     NewSt4 = commit_compaction_data(NewSt3),\n     NewSt5 = copy_meta_data(NewSt4),\n+    couch_db_plugin:before_copy_purge_info(DbName),","path":"src/couch/src/couch_bt_engine_compactor.erl","position":null,"original_position":4,"commit_id":"c5eb57ba4929182d46cd23973b37d895441e71c6","original_commit_id":"c5eb57ba4929182d46cd23973b37d895441e71c6","user":{"login":"nickva","id":211822,"avatar_url":"https://avatars3.githubusercontent.com/u/211822?v=4","gravatar_id":"","url":"https://api.github.com/users/nickva","html_url":"https://github.com/nickva","followers_url":"https://api.github.com/users/nickva/followers","following_url":"https://api.github.com/users/nickva/following{/other_user}","gists_url":"https://api.github.com/users/nickva/gists{/gist_id}","starred_url":"https://api.github.com/users/nickva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickva/subscriptions","organizations_url":"https://api.github.com/users/nickva/orgs","repos_url":"https://api.github.com/users/nickva/repos","events_url":"https://api.github.com/users/nickva/events{/privacy}","received_events_url":"https://api.github.com/users/nickva/received_events","type":"User","site_admin":false},"body":"Does it have to be a plugin at all? How is a plugin better than a function call here?","created_at":"2018-03-12T16:23:45Z","updated_at":"2018-03-12T16:23:45Z","html_url":"https://github.com/apache/couchdb/pull/1187#discussion_r173858455","pull_request_url":"https://api.github.com/repos/apache/couchdb/pulls/1187","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/couchdb/pulls/comments/173858455"},"html":{"href":"https://github.com/apache/couchdb/pull/1187#discussion_r173858455"},"pull_request":{"href":"https://api.github.com/repos/apache/couchdb/pulls/1187"}},"in_reply_to_id":173852178},"pull_request":{"url":"https://api.github.com/repos/apache/couchdb/pulls/1187","id":172191608,"html_url":"https://github.com/apache/couchdb/pull/1187","diff_url":"https://github.com/apache/couchdb/pull/1187.diff","patch_url":"https://github.com/apache/couchdb/pull/1187.patch","issue_url":"https://api.github.com/repos/apache/couchdb/issues/1187","number":1187,"state":"open","locked":false,"title":"[WIP] Couchdb 3326 clustered purge","user":{"login":"jiangphcn","id":18000622,"avatar_url":"https://avatars3.githubusercontent.com/u/18000622?v=4","gravatar_id":"","url":"https://api.github.com/users/jiangphcn","html_url":"https://github.com/jiangphcn","followers_url":"https://api.github.com/users/jiangphcn/followers","following_url":"https://api.github.com/users/jiangphcn/following{/other_user}","gists_url":"https://api.github.com/users/jiangphcn/gists{/gist_id}","starred_url":"https://api.github.com/users/jiangphcn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiangphcn/subscriptions","organizations_url":"https://api.github.com/users/jiangphcn/orgs","repos_url":"https://api.github.com/users/jiangphcn/repos","events_url":"https://api.github.com/users/jiangphcn/events{/privacy}","received_events_url":"https://api.github.com/users/jiangphcn/received_events","type":"User","site_admin":false},"body":"<!-- Thank you for your contribution!\r\n\r\n     Please file this form by replacing the Markdown comments\r\n     with your text. If a section needs no action - remove it.\r\n\r\n     Also remember, that CouchDB uses the Review-Then-Commit (RTC) model\r\n     of code collaboration. Positive feedback is represented +1 from committers\r\n     and negative is a -1. The -1 also means veto, and needs to be addressed\r\n     to proceed. Once there are no objections, the PR can be merged by a\r\n     CouchDB committer.\r\n\r\n     See: http://couchdb.apache.org/bylaws.html#decisions for more info. -->\r\n\r\n## Overview\r\n\r\n<!-- Please give a short brief for the pull request,\r\n     what problem it solves or how it makes things better. -->\r\n\r\nThe primary purpose of clustered purge is to clean databases that have multiple deleted tombstones or single documents that contain large numbers of conflicts. But it can also be used to purge any document (deleted or non-deleted) with any number of revisions.\r\n\r\nClustered Purge was designed to maintain eventual consistency and prevent unnecessary invalidation of secondary indexes. For this, every database keeps track of a certain number of historical purges requested in the database, as well as its current ``purge_seq``. Internal replications and secondary indexes process database's purges and periodically update their corresponding purge checkpoint documents to report ``purge_seq`` processed by them. To ensure eventual consistency, the database will remove store historical purges only after they have been processed by internal replication jobs and secondary indexes.\r\n\r\n## Testing recommendations\r\n\r\n<!-- Describe how we can test your changes.\r\n     Does it provides any behaviour that the end users\r\n     could notice? -->\r\n```\r\nmake check apps=couch tests=couch_bt_engine_test_\r\nmake check apps=couch tests=couch_db_purge_docs_test_\r\nmake check apps=couch_mrview tests=view_purge_test_\r\nmake check apps=couch_mrview tests=view_purge_fabric_test_\r\nmake check apps=fabric\r\nmake check apps=chttpd tests=purge_test_\r\n```\r\n\r\n## JIRA issue number\r\nhttps://issues.apache.org/jira/browse/COUCHDB-3326\r\n\r\n## Related Issues or Pull Requests\r\n\r\n<!-- If your changes affects multiple components in different\r\n     repositories please put links to those issues or pull requests here.  -->\r\n\r\nhttps://github.com/apache/couchdb/pull/1186\r\n\r\n## Checklist\r\n\r\n- [X] Code is written and works correctly;\r\n- [X] Changes are covered by tests;\r\n- [X] Documentation reflects the changes;\r\n","created_at":"2018-03-01T10:05:24Z","updated_at":"2018-03-12T16:23:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9dd5bb6a5495322c7f246f57542cc436ab93fc49","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/couchdb/pulls/1187/commits","review_comments_url":"https://api.github.com/repos/apache/couchdb/pulls/1187/comments","review_comment_url":"https://api.github.com/repos/apache/couchdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/couchdb/issues/1187/comments","statuses_url":"https://api.github.com/repos/apache/couchdb/statuses/c5eb57ba4929182d46cd23973b37d895441e71c6","head":{"label":"cloudant:COUCHDB-3326-clustered-purge","ref":"COUCHDB-3326-clustered-purge","sha":"c5eb57ba4929182d46cd23973b37d895441e71c6","user":{"login":"cloudant","id":44642,"avatar_url":"https://avatars0.githubusercontent.com/u/44642?v=4","gravatar_id":"","url":"https://api.github.com/users/cloudant","html_url":"https://github.com/cloudant","followers_url":"https://api.github.com/users/cloudant/followers","following_url":"https://api.github.com/users/cloudant/following{/other_user}","gists_url":"https://api.github.com/users/cloudant/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudant/subscriptions","organizations_url":"https://api.github.com/users/cloudant/orgs","repos_url":"https://api.github.com/users/cloudant/repos","events_url":"https://api.github.com/users/cloudant/events{/privacy}","received_events_url":"https://api.github.com/users/cloudant/received_events","type":"Organization","site_admin":false},"repo":{"id":39005786,"name":"couchdb","full_name":"cloudant/couchdb","owner":{"login":"cloudant","id":44642,"avatar_url":"https://avatars0.githubusercontent.com/u/44642?v=4","gravatar_id":"","url":"https://api.github.com/users/cloudant","html_url":"https://github.com/cloudant","followers_url":"https://api.github.com/users/cloudant/followers","following_url":"https://api.github.com/users/cloudant/following{/other_user}","gists_url":"https://api.github.com/users/cloudant/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudant/subscriptions","organizations_url":"https://api.github.com/users/cloudant/orgs","repos_url":"https://api.github.com/users/cloudant/repos","events_url":"https://api.github.com/users/cloudant/events{/privacy}","received_events_url":"https://api.github.com/users/cloudant/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudant/couchdb","description":"Mirror of Apache CouchDB","fork":true,"url":"https://api.github.com/repos/cloudant/couchdb","forks_url":"https://api.github.com/repos/cloudant/couchdb/forks","keys_url":"https://api.github.com/repos/cloudant/couchdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudant/couchdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudant/couchdb/teams","hooks_url":"https://api.github.com/repos/cloudant/couchdb/hooks","issue_events_url":"https://api.github.com/repos/cloudant/couchdb/issues/events{/number}","events_url":"https://api.github.com/repos/cloudant/couchdb/events","assignees_url":"https://api.github.com/repos/cloudant/couchdb/assignees{/user}","branches_url":"https://api.github.com/repos/cloudant/couchdb/branches{/branch}","tags_url":"https://api.github.com/repos/cloudant/couchdb/tags","blobs_url":"https://api.github.com/repos/cloudant/couchdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudant/couchdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudant/couchdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudant/couchdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudant/couchdb/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudant/couchdb/languages","stargazers_url":"https://api.github.com/repos/cloudant/couchdb/stargazers","contributors_url":"https://api.github.com/repos/cloudant/couchdb/contributors","subscribers_url":"https://api.github.com/repos/cloudant/couchdb/subscribers","subscription_url":"https://api.github.com/repos/cloudant/couchdb/subscription","commits_url":"https://api.github.com/repos/cloudant/couchdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudant/couchdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudant/couchdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudant/couchdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudant/couchdb/contents/{+path}","compare_url":"https://api.github.com/repos/cloudant/couchdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudant/couchdb/merges","archive_url":"https://api.github.com/repos/cloudant/couchdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudant/couchdb/downloads","issues_url":"https://api.github.com/repos/cloudant/couchdb/issues{/number}","pulls_url":"https://api.github.com/repos/cloudant/couchdb/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudant/couchdb/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudant/couchdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudant/couchdb/labels{/name}","releases_url":"https://api.github.com/repos/cloudant/couchdb/releases{/id}","deployments_url":"https://api.github.com/repos/cloudant/couchdb/deployments","created_at":"2015-07-13T10:27:13Z","updated_at":"2017-11-23T19:32:54Z","pushed_at":"2018-03-09T10:47:36Z","git_url":"git://github.com/cloudant/couchdb.git","ssh_url":"git@github.com:cloudant/couchdb.git","clone_url":"https://github.com/cloudant/couchdb.git","svn_url":"https://github.com/cloudant/couchdb","homepage":null,"size":33942,"stargazers_count":6,"watchers_count":6,"language":"Erlang","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":3,"open_issues":0,"watchers":6,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"49d41949f59d39e3f1d24f76e8bf281dd17745f5","user":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":206417,"name":"couchdb","full_name":"apache/couchdb","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/couchdb","description":"Apache CouchDB","fork":false,"url":"https://api.github.com/repos/apache/couchdb","forks_url":"https://api.github.com/repos/apache/couchdb/forks","keys_url":"https://api.github.com/repos/apache/couchdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/couchdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/couchdb/teams","hooks_url":"https://api.github.com/repos/apache/couchdb/hooks","issue_events_url":"https://api.github.com/repos/apache/couchdb/issues/events{/number}","events_url":"https://api.github.com/repos/apache/couchdb/events","assignees_url":"https://api.github.com/repos/apache/couchdb/assignees{/user}","branches_url":"https://api.github.com/repos/apache/couchdb/branches{/branch}","tags_url":"https://api.github.com/repos/apache/couchdb/tags","blobs_url":"https://api.github.com/repos/apache/couchdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/couchdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/couchdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/couchdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/couchdb/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/couchdb/languages","stargazers_url":"https://api.github.com/repos/apache/couchdb/stargazers","contributors_url":"https://api.github.com/repos/apache/couchdb/contributors","subscribers_url":"https://api.github.com/repos/apache/couchdb/subscribers","subscription_url":"https://api.github.com/repos/apache/couchdb/subscription","commits_url":"https://api.github.com/repos/apache/couchdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/couchdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/couchdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/couchdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/couchdb/contents/{+path}","compare_url":"https://api.github.com/repos/apache/couchdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/couchdb/merges","archive_url":"https://api.github.com/repos/apache/couchdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/couchdb/downloads","issues_url":"https://api.github.com/repos/apache/couchdb/issues{/number}","pulls_url":"https://api.github.com/repos/apache/couchdb/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/couchdb/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/couchdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/couchdb/labels{/name}","releases_url":"https://api.github.com/repos/apache/couchdb/releases{/id}","deployments_url":"https://api.github.com/repos/apache/couchdb/deployments","created_at":"2009-05-21T02:03:38Z","updated_at":"2018-03-12T16:19:30Z","pushed_at":"2018-03-09T19:46:48Z","git_url":"git://github.com/apache/couchdb.git","ssh_url":"git@github.com:apache/couchdb.git","clone_url":"https://github.com/apache/couchdb.git","svn_url":"https://github.com/apache/couchdb","homepage":"","size":27798,"stargazers_count":3510,"watchers_count":3510,"language":"Erlang","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":759,"mirror_url":null,"archived":false,"open_issues_count":106,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":759,"open_issues":106,"watchers":3510,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/couchdb/pulls/1187"},"html":{"href":"https://github.com/apache/couchdb/pull/1187"},"issue":{"href":"https://api.github.com/repos/apache/couchdb/issues/1187"},"comments":{"href":"https://api.github.com/repos/apache/couchdb/issues/1187/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/couchdb/pulls/1187/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/couchdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/couchdb/pulls/1187/commits"},"statuses":{"href":"https://api.github.com/repos/apache/couchdb/statuses/c5eb57ba4929182d46cd23973b37d895441e71c6"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nickva"}}