couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <...@jsonified.com>
Subject Re: Doc Not Restored After PURGE
Date Thu, 24 Oct 2013 07:12:52 GMT
On 23. Oktober 2013 at 23:05:47, Brad Rhoads (bdrhoa@gmail.com) wrote:
>
>Say I have two databases, theSource and theTarget, then:
>
>Add docs 1,2 & 3 to theSource.
>Replicate theSource to theTarget.
>PURGE doc 2 from theTarget.
>Replicate theSource to theTarget again.
>
>I'd expect doc 2 to be restored to theTarget, but it is not being resorted.
>
>I've tested this in 1.2 and 1.3. I don't have 1.4 setup yet, so I haven't
>tested this senario on 1.4.
>
>Am I misunderstanding how this is supposed to work, or is there a bug?
>
>Thanks!
>
>-Brad

Hey Brad,

TL;DR purge is not for normal usage, YMMV, as you’ve noticed, is really only intended for
the situation when you store your Swiss Bank Account details in a doc.

If you add a 3rd node, theTardis, to this mix, and set up 2 replications, theSource->theTardis->theTarget,
then the doc will re-appear on theTarget as you might expect, as theMardis won’t have knowledge
of the sequence number updates that are shared knowledge between theSource & theTarget.

BTW other than curiosity, what are you trying to achieve here?

The only way I would feel comfortable achieving a purge in a *production* replicated system
is to switch to a different DB, replicated off theSource, and then progressively drop each
replicated node off one by one, adding the new db in one by one, including a validation doc
that will not accept the purged doc id.

Finally, all endpoints and instances that keep some state (docs) need to be disinfected of
the tainted doc entirely. Distributed systems are hard & confusing even on a good day.
Just thinking about this in a sharded cluster gives me a headache.

I suspect I’m not alone in thinking that removing purge entirely from the API would not
be a Bad Thing, as the more nodes / endpoints you add, the less likely it is to work the way
you’d casually (causally?) expect.

A+
Dave




Mime
View raw message