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

Invalid chunk when database is deleted while a continuous change request is running

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • HTTP Interface
    • None

    Description

      If the database is deleted while a continuous change request is running, a new bunch of HTTP headers and a JSON payload explaining the error are emitted instead of just a JSON payload using the proper chunked response format.

      This is a regression as this situation closed the stream properly in CouchDB 1.x while sending the a JSON payload containing a proper "last_seq" corresponding to the latest update sequence sent to this interrupted _changes stream.

      Example response (wire format dump from wireshark) sent by CouchDB 2.0.0-RC4 if the database is deleted while the _changes request is running:

      POST /canape-test-db-45b83172-8355-45a9-867d-e6b8d6c205a6/_changes?heartbeat=30000&feed=continuous HTTP/1.1
      User-Agent: canape for Scala
      Accept: application/json
      Host: localhost:5984
      Content-Type: application/json
      Content-Length: 0
      
      HTTP/1.1 200 OK
      Cache-Control: must-revalidate
      Content-Type: application/json
      Date: Tue, 06 Sep 2016 12:37:32 GMT
      Server: CouchDB/1df597f (Erlang OTP/17)
      Transfer-Encoding: chunked
      X-Couch-Request-ID: 7992b39f23
      X-CouchDB-Body-Time: 0
      
      1
      
      
      15c
      {"seq":"1-g1AAAAIHeJyN0MENgjAUgOGnmKgHZ9ARWqgUTrKJvrYQJFgO6lk30U10E90EizUBTEh6eU2a_l-TVwLALPcULHSlK5Umusqr46k012MEsazrusg9HB3MxTRASX2C_48HcrEyU2x-AnyFMEaSEapgftYqzfY6VUN10tTbXi1oEPlSudS7pr70aolRwEjsUOuJmXA1hwFunf8jGoYMnYW7FR6twDHz_TBwFp5WeLXCmgsuI5cdWOFthc4eUHLGY9YVig9FlJt6","id":"docid1","changes":[{"rev":"1-967a00dff5e02add41819138abb3284d"}]}
      
      1
      
      
      160
      {"seq":"2-g1AAAAILeJyNkEsOgjAQhquYqAvPoEfoyxZWchPtA4IE24W61pvoTfQmehMs1gQwIenmn2Qy35eZqQAAsyLSYGGssTpLjS3s8VS59lgAuazruiwiMTq4xpQIhTAU_8MDuFy5lJufAXwNLBEwh0iD-dnoLN-bTA_RaUNve7REJMZKh9C7hr70aCViQmESQJuJS3B1xQlu7f0yRozR0Pu95e4tj3YPLnKMGQne4-kNr9aw5pKrOOQP3vD2hs4vhOKUJ7RrKD8Y3J0r","id":"docid2","changes":[{"rev":"1-967a00dff5e02add41819138abb3284d"}]}
      
      1
      
      
      160
      {"seq":"3-g1AAAAIPeJyNkUsOgjAQQKuYqAvPoEfoT1pWchPtB4IE24W61pvoTfQmehMs1gQhIelmJpnMe5lPBQCYFZEGC2ON1VlqbGGPp8qVxwLIZV3XZRGJ0cEVpkQohKHoNw_gcuWi3PwM4GuIEwFziDSYn43O8r3J9BCdNvS2Q0tEOFY6hN419KVDK8EJhUkAbSYugqtLTnBr95ccxTEN3d9b7t7yaOdgIsc4JsFzPL3h1RrWTDLFQ-7gDW9v-PukUIyyhPaZ8gORx57c","id":"docid3","changes":[{"rev":"1-967a00dff5e02add41819138abb3284d"}]}
      
      HTTP/1.1 500 Internal Server Error
      Cache-Control: must-revalidate
      Content-Length: 48
      Content-Type: application/json
      Date: Tue, 06 Sep 2016 12:37:32 GMT
      Server: CouchDB/1df597f (Erlang OTP/17)
      X-Couch-Request-ID: 7992b39f23
      X-CouchDB-Body-Time: 0
      
      {"error":"changes_feed_died","reason":"normal"}
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sam@rfc1149.net Samuel Tardieu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: