[
https://issues.apache.org/jira/browse/COUCHDB-3326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16408295#comment-16408295
]
ASF subversion and git services commented on COUCHDB-3326:
----------------------------------------------------------
Commit 1495b4b618cfaa5422f7ddd5eea4212b01a71268 in couchdb's branch
refs/heads/COUCHDB-3326-clustered-purge-davisp-refactor from [~mayyas]
[ https://gitbox.apache.org/repos/asf?p=couchdb.git;h=1495b4b ]
Implement clustered purge API
* Implement clustered endpoint to purge docs on all nodes
- implement fabric:purge_docs(DbName, IdsRevs, Options)
- generate a unique ID: "UUID" for every purge request before
sending them to workers on specific node.
- fabric_rpc:purge_docs has an option of "replicated_changes" or
or "interactive edit" that are passed to couch_db:purge_docs/3.
This done so that "replicated_changes" updates will not reapply
purges with UUIDs that already exist on a node.
* Fix read-repair
- fix read-repair so not to recreate docs that have been purged before
on a certain node from nodes that are out of sync.
- In the open docs calls we track which nodes sent which revisions. If we
detect the need for read repair, we send this list of (node, rev) pairs
as an option to the fabric:update_docs call. When fabric:update_docs
receives a list of (node, rev) pairs it will use this information to know
whether it should apply the update or ignore it. It checks the
_local/purge-mem3.. docs to see if the purge_seq is up to date.
If not it should ignore the update request. As an optimization,
if the purge_seq is less than a configurable limit
out of sync, the updater sequentially scans the purge_seq tree
looking for purge requests for the given revision and if not found can
continue with the write.
* Implement clustered endpoint to set purged_docs_limit of Db on all nodes
- implement fabric:set_purged_docs_limit(DbName, Limit, Options)
* Implement clustered endpoint to get purged_docs_limit
- implement fabric:get_purged_docs_limit(DbName)
COUCHDB-3326
> Implement clustered purge API: _purge
> -------------------------------------
>
> Key: COUCHDB-3326
> URL: https://issues.apache.org/jira/browse/COUCHDB-3326
> Project: CouchDB
> Issue Type: New Feature
> Components: Database Core, Documentation, HTTP Interface
> Reporter: Mayya Sharipova
> Priority: Major
>
> This implements the clustered purge API:
> {code:}
> curl -H 'Content-Type: application/json' -X POST
> "http://adm:[email protected]:5984/test1/_purge" -d
> '{"d1":["3-410e46c04b51b4c3304ed232790a49da",
> "3-420e46c04b51b4c3304ed232790a35db"],"d2":["2-a39d6d63f29a956ae39930f84dd71ec3"],
> "d3":["1-bdca7a3ac9503bf6e46d7d7a782e8f03"]}'
> {code}
> Response: status_code 201 or 202
> {code:javascript}
> {
> "purged": [
> {
> "ok": true, //Quorum was reached, at least W nodes
> successfully purged doc
> "id": "d1",
> "revs": [
> "3-410e46c04b51b4c3304ed232790a49da",
> "3-420e46c04b51b4c3304ed232790a35db"
> ]
> },
> {
> "accepted": true, //Quorum was NOT reached, but request was
> accepted
> "id": "d2",
> "revs": [
> "2-a39d6d63f29a956ae39930f84dd71ec3"
> ]
> },
> {
> "ok": true,
> "id": "d3",
> "revs": [] //(DocId or Revs missing) OR (Revs are not leaf
> revisions)
> } ],
> "purge_seq":
> "6-g1AAAABMeJzLYWBgYMpgTmHgz8tPSTV2MDQy1zMAQsMckEQiQ5L8____sxKZ4UoMcSrJAgC9PRRl"
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)