Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-3353

_bulk_docs incorrectly creates missing documents instead of returning conflict

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 2.0.0
    • None
    • None
    • None

    Description

      If I attempt to update a missing document via the _bulk_docs endpoint with curl, using a single doc, everything works as expected:

      curl -v -X POST http://admin:abc123@localhost:6001/foo/_bulk_docs -H "Content-Type: application/json" -d '{"docs":[

      {"_id":"bogus","_rev":"4-asb"}

      ]}'

      returns:

      [

      {"id":"bogus","error":"conflict","reason":"Document update conflict."}

      ]

      But if I include a second valid doc (creating one in this example):

      curl -v -X POST http://admin:abc123@localhost:6001/foo/_bulk_docs -H "Content-Type: application/json" -d '{"docs":[

      {"name":"Bob"}

      ,

      {"_id":"bogus","_rev":"4-asb"}

      ]}'

      I occasionally get the expected result:

      [

      {"ok":true,"id":"0b7b7e409a37ccb8dcf89165ee74e429","rev":"1-5a26fa4b20e40bc9e2d3e47b168be460"}

      ,

      {"id":"bogus","error":"conflict","reason":"Document update conflict."}

      ]

      And I occasionally (~50% of the time?) get that both docs are created (!!!):

      [

      {"ok":true,"id":"0b7b7e409a37ccb8dcf89165ee760150","rev":"1-5a26fa4b20e40bc9e2d3e47b168be460"}

      ,

      {"ok":true,"id":"bogus","rev":"5-19d41415e604c9e24813778b745f9407"}

      ]

      Attachments

        Activity

          People

            Unassigned Unassigned
            flimzy Jonathan Hall
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: