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

Regression: attachment Etag references to document revision, not to digest

    XMLWordPrintableJSON

Details

    Description

      In CouchDB 1.6.1:

      $ curl -XPUT http://localhost:5984/db/doc/att -d 'Hello, CouchDB!' -H "Content-Type: text/plain"
      {"ok":true,"id":"doc","rev":"1-3ead39fb9d2538602f817e0bdc00fe26"}
      
      $ curl -XGET -v http://localhost:5984/db/doc/att
      * Hostname was NOT found in DNS cache
      *   Trying 127.0.0.1...
      * Connected to localhost (127.0.0.1) port 5984 (#0)
      > GET /db/doc/att HTTP/1.1
      > User-Agent: curl/7.39.0
      > Host: localhost:5984
      > Accept: */*
      > 
      < HTTP/1.1 200 OK
      < Server: CouchDB/1.7.0 (Erlang OTP/17)
      < ETag: "+4vGmBKGmQoMe7ojcTyiSA=="
      < Date: Sun, 19 Apr 2015 01:17:41 GMT
      < Content-Type: text/plain
      < Content-Length: 15
      < Cache-Control: must-revalidate
      < Accept-Ranges: none
      < 
      * Connection #0 to host localhost left intact
      Hello, CouchDB!%   
      

      In CouchDB 2.0:

      $ curl -XPUT http://localhost:15984/db/doc/att -d 'Hello, CouchDB!' -H "Content-Type: text/plain"
      {"ok":true,"id":"doc","rev":"1-3ead39fb9d2538602f817e0bdc00fe26"}
      
      $ curl -XGET -v http://localhost:15984/db/doc/att
      * Hostname was NOT found in DNS cache
      *   Trying 127.0.0.1...
      * Connected to localhost (127.0.0.1) port 15984 (#0)
      > GET /db/doc/att HTTP/1.1
      > User-Agent: curl/7.39.0
      > Host: localhost:15984
      > Accept: */*
      > 
      < HTTP/1.1 200 OK
      < Server: CouchDB/42c9047 (Erlang OTP/17)
      < ETag: "1-3ead39fb9d2538602f817e0bdc00fe26"
      < Date: Sun, 19 Apr 2015 01:14:11 GMT
      < Content-Type: text/plain
      < Content-Length: 15
      < Cache-Control: must-revalidate
      < Accept-Ranges: none
      < 
      * Connection #0 to host localhost left intact
      Hello, CouchDB!%
      

      If document becomes updated, but attachment does not, their Etag changes as well:

      $ curl -XGET -v http://localhost:15984/db/doc/att
      * Hostname was NOT found in DNS cache
      *   Trying 127.0.0.1...
      * Connected to localhost (127.0.0.1) port 15984 (#0)
      > GET /db/doc/att HTTP/1.1
      > User-Agent: curl/7.39.0
      > Host: localhost:15984
      > Accept: */*
      > 
      < HTTP/1.1 200 OK
      < Server: CouchDB/42c9047 (Erlang OTP/17)
      < ETag: "3-90c8a1947115ffb2032a217ed3d3c624"
      < Date: Sun, 19 Apr 2015 01:15:55 GMT
      < Content-Type: text/plain
      < Content-Length: 15
      < Cache-Control: must-revalidate
      < Accept-Ranges: none
      < 
      * Connection #0 to host localhost left intact
      Hello, CouchDB!%
      

      Attachments

        Activity

          People

            rnewson Robert Newson
            kxepal Alexander Shorin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: