couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <>
Subject Re: Purging documents and view invalidation
Date Mon, 08 Jul 2013 17:59:35 GMT

On Jul 8, 2013, at 12:46 AM, Jason Smith <> wrote:

> It is still "as if the document had never existed" because these three
> procedures are equivalent (modulo my own misunderstanding of the question
> or CouchDB's code)

So, I can’t speak for CouchDB, but here’s what TouchDB does based on my reverse-engineered
knowledge of the algorithm:

> * Replicate all docs; purge doc "foo"; replicate again

TouchDB will not pull “foo” — but I think this is a bug. This is probably where I need
to track the source database’s purge_seq as I alluded to in the previous message. People
have already run into this in iOS apps and been confused by the current behavior.

> * Replicate with a source filter that blocks doc "foo"; replicate again

Yup. Changing the filter function changes the replication ID, so it’ll cause a restart from
sequence zero.

> * Replicate with target validate_doc_update that rejects "foo"; replicate
> again

I think you meant to include a second step “modify the target validation function so that
it now accepts ‘foo’” ... ?

TouchDB won’t replicate “foo” in this case because changing a validation function doesn’t
change the replication ID or otherwise invalidate the replication. Maybe it should?

View raw message