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

CouchDB 2.0: Race condition when creating/deleting database

    XMLWordPrintableJSON

Details

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

    Description

      I've noticed that CouchDB 2.0 (master) occasionally returns 500 errors when multiple clients attempt to PUT or DELETE the same database concurrently. This is reproducible by running multiple instances of following script in parallel against an n=1 (single node) cluster:

      #!/bin/bash
      
      for i in `seq 1 2000`;
      do
      	printf '\nPUT: '
          curl -XPUT 'http://localhost:15984/testdb' -w "%{http_code}\\n"
          printf '\nDELETE: '
          curl -XDELETE 'http://localhost:15984/testdb' -w "%{http_code}\\n"
      done
      

      This generates output along the lines of:

      PUT: {"ok":true}
      201
      
      DELETE: {"ok":true}
      200
      
      PUT: {"error":"error","reason":"internal_server_error"}
      500
      
      DELETE: {"error":"not_found","reason":"Database does not exist."}
      404
      
      PUT: {"error":"file_exists","reason":"The database could not be created, the file already exists."}
      412
      
      DELETE: {"ok":true}
      200
      
      PUT: {"error":"file_exists","reason":"The database could not be created, the file already exists."}
      412
      
      DELETE: {"ok":true}
      200
      
      PUT: {"ok":true}
      201
      
      DELETE: {"ok":true}
      200
      

      I can't reproduce the error against CouchDB 1.6 or CouchDB master on port 15986 (bypassing the clustering).

      Attachments

        1. node1.log
          192 kB
          Will Holley

        Activity

          People

            Unassigned Unassigned
            wilhol Will Holley
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: