incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Goodall <>
Subject Re: can you detect consistency?
Date Wed, 21 Apr 2010 09:43:27 GMT
On 21 April 2010 10:11, Rachel Willmer <> wrote:
> Say I have 2 couchdb nodes which replicate bi-directionally.
> Is there a way of detecting that they have reached consistency?
> (assuming that changes have stopped being made and that the
> replication has done its thing)
> By trial and error, I can see that in a scenario where I have two
> nodes which do in fact have the same data (which I've verified by
> scripting a doc-by-doc check that their revs are the same, and their
> contents are the same); in that scenario, the update_seq is different
> on the two nodes.
> So I have 2 questions:
> a) is that expected or a bug? (my guess is that it's expected)

I assume you mean the differing seq nums here? Yes, it's expected. The
seq num is local to each database.

> b) is there any other way of detecting consistency quickly?

As you discovered, once bi-di replication has completed the revs of
the replicated docs are the same in both databases. This is by design.
In the case of a conflict, CouchDB picks the winning rev in a
predictable way to ensure that even conflicts are eventually

I don't know of anything at the database level you can actually check
to test for consistency but assuming nothing is writing to either
database during replication then knowing that replication is complete
should be enough.

- Matt

View raw message