Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Purge throws "this feature is not yet implemented" #1378

Closed
tudordumitriu opened this issue Jun 7, 2018 · 16 comments
Closed

Purge throws "this feature is not yet implemented" #1378

tudordumitriu opened this issue Jun 7, 2018 · 16 comments

Comments

@tudordumitriu
Copy link

tudordumitriu commented Jun 7, 2018

Expected Behavior

Should purge the document as in documentation

Current Behavior

Returns an error message
{
"error": "not_implemented",
"reason": "this feature is not yet implemented"
}

Steps to Reproduce (for bugs)

  1. Triggering a HTTP POST to http://localhost:5984/userdb-61/_purge with ({"id": ["rev"]})
  2. Returns the above error

Context

We are having a db with lots of _deleted docs, that is sync with PouchDB and we need to clean them up because they are getting replicated. So we are getting All Changes and from each change we're using the doc id and rev to trigger a POST to _purge

Your Environment

@jiangphcn
Copy link
Contributor

Clustered Purge is under development. Hopefully it can help solve your problem once it lands.

@wohali
Copy link
Member

wohali commented Jun 7, 2018

Duplicate of #1352.

@wohali wohali closed this as completed Jun 7, 2018
@wohali
Copy link
Member

wohali commented Jun 7, 2018

As a workaround, you can do a filtered replication to another database that removes the tombstones.

See https://eclipsesource.com/blogs/2015/04/20/how-to-finally-delete-documents-in-couchdb/ and especially the comment thread posts by @willholley .

@tudordumitriu
Copy link
Author

@jiangphcn: Thanks, but I thought it would have worked for single node, or am I confusing something? Also when do you think this would be delivered? Thanks again?
@wohali: Thanks but my db is the db of a user created by per user db config, so can't really do that, any other suggestions?

@jiangphcn
Copy link
Contributor

For single node purge, you need to use couch_db:purge_docs(Db1, [{<<"doc1">>, [Rev1]}]). to purge document. However, you need to stop mem3 to avoid unexpected replication. Also anyway this may cause the rebuild of index. If you can accept these side effects, you can have a try with local node purge.

@davisp and myself are working on clustered purge and code was under review process.

@tudordumitriu
Copy link
Author

@jiangphcn: Thanks again. Great news, this means it might get shipped with next version? Maybe I am pushing too much, but is there a release date?
Also I need to mention we are using this via REST API so not familiar with your suggested solution,

@jiangphcn
Copy link
Contributor

I can't accurately say when it will be released for now because there are multiple factors to decide how long it will take to complete this feature. But it should be available in near future. Also, the clustered purge is also to provide REST API approach for usage.

@jlami
Copy link

jlami commented Jul 31, 2018

I'm also a user not not familiar with ERL. So a public api for _purge would be very helpful in complying with GDPR.
Any status update for this?

@wohali
Copy link
Member

wohali commented Jul 31, 2018

No sooner than CouchDB 2.3.0.

@wohali
Copy link
Member

wohali commented Jul 31, 2018

@jlami Also, remember that a delete followed by a compact will remove all record of a document except for the _id and _rev fields. You only need purge for GDPR if you have sensitive data in the _id field itself.

@jlami
Copy link

jlami commented Jul 31, 2018

But for now we are disabling compaction to use the revisions for history. I know, misuse of a feature. But it seemed like a good thing at the time.

Compaction can't really be triggered manually can it?
[edit] Aaaah, sure: /{db}/_compact works

@LastStarDust
Copy link

LastStarDust commented Sep 17, 2018

Hello! I am experiencing the same problem on a single-node configuration of CouchDB (not clustered).
I am not using CouchDB directly but only through another application called Pyrame.
In the link, you can look at the portion of code that throws the error. In turn, this application makes use of the purge function offered by the couchdb-python package.
I am a physicists and not a server administrator so my knowledge of the inner working of CouchDB is very limited. I read from above that there is a workaround but I cannot understand how to use it.
Could you please explain to me how to modify the Pyrame or couchdb-python code to make use of the workaround? I know that it is not strictly "your job" to do so and apologize for the strange request.
I am using CouchDB 2.2.0~bionic and Ubuntu 18.04. CouchDB was installed from the repositories.

@jiangphcn
Copy link
Contributor

@LastStarDust Clustered purge is not in CouchDB 2.2, but was just merged to CouchDB master branch. You can see more information about this new feature from https://github.com/apache/couchdb-documentation/pull/285/files.

@LastStarDust
Copy link

@jiangphcn Thank you for the hint. Anyway I am using a single-node configuration and I am getting the same error. I tried to compile from source the master branch but I got stuck because of other errors. If possible I would like to stick using the repository version of couchdb.

@wohali
Copy link
Member

wohali commented Sep 17, 2018

@LastStarDust The next released version of CouchDB will include purge functionality. Or, you can go back to CouchDB 1.x.

@LastStarDust
Copy link

Ok clear! I will downgrade to
1.x for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants