couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <d...@muse.net.nz>
Subject Re: Delete replication history
Date Sat, 24 Dec 2011 11:56:54 GMT
On 24 December 2011 02:30, Jim Klo <jim.klo@sri.com> wrote:
> Trying to test a validate_doc_update function for use in replication.
>
> Is there a way to reset or delete the replication history so I don't have to continuously
recreate my target db?
>
> Thanks,
>
> - Jim

Jim,

There's no such thing as a replication history, only replicated
documents. So you have a few choices;

Recreate your db if you're starting from scratch this is as simple as
an additional line in your test script, curl -X DELETE $DB ; curl -X
PUT $DB.

If you're not starting from scratch, then you can simply copy the
fresh db somewhere as a backup, and re-copy it back with, say, rsync,

You may find it easier to start a js interpreter up and work through
the validation function directly, using the process outlined in
http://wiki.apache.org/couchdb/Troubleshooting#Map.2BAC8-Reduce_debugging
obviously you'll need to get a sample userCtx as well. I would think
you can use the same logging function as the view server "log(stuff);"
to do this. Note this is not for use on production DBs due to heavy
perf impact.

Pro-tip: don't forget to accept all _deleted docs through your
function to ensure MVCC continues to work as expected.

A+
Dave

Mime
View raw message