couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randall Leeds <randall.le...@gmail.com>
Subject Re: Replication Filters: When changing restrictions data becomes out of sync
Date Tue, 06 Apr 2010 02:17:04 GMT
I apologize. I was not clear.

There is a feature of CouchDB called update_notifications that allows
an external process, supervised by Erlang, to be sent information
about document updates.

Unfortunately, this feature is not well documented, but you can see a
couple examples[1][2].

It's not elegant, but it might work for you depending on how complex
your use case is. You can use whatever language and HTTP client
library you like to issue the appropriate commands.

You could also write a daemon that consumes the ?changes feed.

You might load all the _design documents at the beginning. When the
design document is updated, compare the filter functions to see if
they've changed. You could fetch all the documents one by one or in
chunks and run them through the old filter and the new filter and see
which ones should no longer be replicated and issue a DELETE.

In short, there's no particularly efficient way to handle "correcting"
a changed replication filter. But you can work around it if you're
really determined.

[1] http://wiki.apache.org/couchdb/Regenerating_views_on_update?highlight=(update\_notification)
[2] http://github.com/tilgovi/couchdb-lounge/raw/master/replicator/replication_notifier.py

Mime
View raw message