incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Lehnardt <>
Subject Re: Write race conditions, working without _rev
Date Thu, 18 Nov 2010 17:37:05 GMT

On 18 Nov 2010, at 02:56, Chad George wrote:

> I guess I was more wondering if its possible for two calls to the update
> function to "see" the same revision of the document. Or if it was possible
> for another call to document API to successfully update a document *while*
> the update handler is processing?
> Are you saying that all the processing of HTTP calls and related javascript
> calls are all effectively serialized so this can't happen?
> It seemed by Jan's comments that a _rev collision can occur with update
> handlers.
> And maybe most importantly, when an update handler fails to write the
> document what happens? I didn't see any tests for this in
> update_documents.js but maybe I missed something.

You get the regular 412 response as if you would provide no or an out of date


> On Wed, Nov 17, 2010 at 8:14 PM, Randall Leeds <>wrote:
>> On Wed, Nov 17, 2010 at 16:15, Chad George <> wrote:
>>> I've been wondering about this for a while, when two update requests for
>> the
>>> same document come to couchdb nearly simultaneously what exactly happens?
>>> Is it possible for both requests to get the same revision of the document
>> to
>>> update or is there some mechanism to force the updates to occur in
>> series?
>> There is a mechanism. The message passing within the Erlang runtime
>> guarantee an ordering of messages to the update process.
>> It is impossible for both updates to occur.

View raw message