couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Newson (JIRA)" <>
Subject [jira] [Commented] (COUCHDB-1510) new_edits=false on new document causes function_clause error
Date Sat, 07 Jul 2012 15:21:35 GMT


Robert Newson commented on COUCHDB-1510:

I'm mistaken. The bug is doing ?new_edits=false when the body being PUT/POST'ed does not contain
a _rev value. So this should be a 400.
> new_edits=false on new document causes function_clause error
> ------------------------------------------------------------
>                 Key: COUCHDB-1510
>                 URL:
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 1.2
>            Reporter: Robert Newson
>            Assignee: Robert Newson
>             Fix For: 1.2.1, 1.3
> The code for handling new_edits=false assumes a previous revision;
> couch_db_updater.erl;
>   fun({Client, {#doc{revs={Pos,[_Rev|PrevRevs]}}=NewDoc, Ref}}, AccTree) ->
> but in the case of a new document, there isn't one. The user then receives an error,
the updater process dies with a function clause.
> The problem here is that a user (elliotcm) is doing new_edits=false for all requests,
and the intensity of the gen_server crashes under load is sufficient to propogate upward to
the top supervisor, crashing couchdb.
> So, is the correct behavior to return a 400 or a 201?
> #!/bin/sh                                                                           
> URL=http://localhost:5984/mergetest
> curl -XDELETE $URL
> curl -XPUT $URL
> curl -XPUT -d '{}' $URL/doc?new_edits=false

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message