[ 
https://issues.apache.org/jira/browse/COUCHDB-2859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14985644#comment-14985644
 ] 

ASF GitHub Bot commented on COUCHDB-2859:
-----------------------------------------

GitHub user KlausTrainer opened a pull request:

    https://github.com/apache/couchdb-chttpd/pull/92

    Don't set random ETag header for views

    This fixes the issue that by setting a random ETag header, we implicitly
    promised that there's a chance of a cache hit where there was no chance.
    
    For 2.0, we simply remove the random ETag without replacement, in order
    to not accidentally cause useless cache bloat in clients.
    
    Here's Robert Newson's idea for an implementation that should be no more
    expensive than what we do today:
    
    1) delay the response until we have heard from one shard of each range
    2) from this, construct the etag (we can change the workers to return
       more information along with their first rows (if any))
    3) send 304 if the etag matches the header
    
    That is, we have to hear from one shard per range to form the view, so
    we can build a useful etag from that.
    
    COUCHDB-2859

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/KlausTrainer/couchdb-chttpd 
2859-remove-view-etags

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-chttpd/pull/92.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #92
    
----
commit 2980714d0dfc7763d0c915f73db2bd4558862abe
Author: Klaus Trainer <[email protected]>
Date:   2015-11-02T17:33:19Z

    Don't set random ETag header for views
    
    This fixes the issue that by setting a random ETag header, we implicitly
    promised that there's a chance of a cache hit where there was no chance.
    
    For 2.0, we simply remove the random ETag without replacement, in order
    to not accidentally cause useless cache bloat in clients.
    
    Here's Robert Newson's idea for an implementation that should be no more
    expensive than what we do today:
    
    1) delay the response until we have heard from one shard of each range
    2) from this, construct the etag (we can change the workers to return
       more information along with their first rows (if any))
    3) send 304 if the etag matches the header
    
    That is, we have to hear from one shard per range to form the view, so
    we can build a useful etag from that.
    
    COUCHDB-2859

----


> View-Etags not working on cluster
> ---------------------------------
>
>                 Key: COUCHDB-2859
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-2859
>             Project: CouchDB
>          Issue Type: Bug
>            Reporter: Sebastian Rothbucher
>            Priority: Blocker
>             Fix For: 2.0.0
>
>
> (from list_views.js Integration test)
> 2 Reproduce: Query view, grab etag, query view again with -H 'if-none-match: 
> <etag>'
> Complete run: 
> {noformat}
> [root@localhost couchdb]# curl -X GET 
> 'http://localhost:15984/test_suite_db/_design/vtest/_view/v' -v
> * About to connect() to localhost port 15984 (#0)
> *   Trying ::1...
> * Verbindungsaufbau abgelehnt
> *   Trying 127.0.0.1...
> * Connected to localhost (127.0.0.1) port 15984 (#0)
> > GET /test_suite_db/_design/vtest/_view/v HTTP/1.1
> > User-Agent: curl/7.29.0
> > Host: localhost:15984
> > Accept: */*
> >
> < HTTP/1.1 200 OK
> < Cache-Control: must-revalidate
> < Content-Type: text/plain; charset=utf-8
> < Date: Sat, 17 Oct 2015 16:44:07 GMT
> < ETag: "16d73d700397bb00da24d90cde000bd1"
> < Server: CouchDB/8924e94 (Erlang OTP/17)
> < Transfer-Encoding: chunked
> < X-Couch-Request-ID: 63c44f488f
> < X-CouchDB-Body-Time: 0
> <
> {"total_rows":1,"offset":0,"rows":[
> {"id":"testdel","key":null,"value":null}
> ]}
> * Connection #0 to host localhost left intact
> [root@localhost couchdb]# curl -X GET 
> 'http://localhost:15984/test_suite_db/_design/vtest/_view/v' -v -H 
> 'if-none-match: "16d73d700397bb00da24d90cde000bd1"'
> * About to connect() to localhost port 15984 (#0)
> *   Trying ::1...
> * Verbindungsaufbau abgelehnt
> *   Trying 127.0.0.1...
> * Connected to localhost (127.0.0.1) port 15984 (#0)
> > GET /test_suite_db/_design/vtest/_view/v HTTP/1.1
> > User-Agent: curl/7.29.0
> > Host: localhost:15984
> > Accept: */*
> > if-none-match: "16d73d700397bb00da24d90cde000bd1"
> >
> < HTTP/1.1 200 OK
> < Cache-Control: must-revalidate
> < Content-Type: text/plain; charset=utf-8
> < Date: Sat, 17 Oct 2015 16:44:24 GMT
> < ETag: "16d73d700397bb00da24d90cde00194f"
> < Server: CouchDB/8924e94 (Erlang OTP/17)
> < Transfer-Encoding: chunked
> < X-Couch-Request-ID: 9a3cd3257b
> < X-CouchDB-Body-Time: 0
> <
> {"total_rows":1,"offset":0,"rows":[
> {"id":"testdel","key":null,"value":null}
> ]}
> * Connection #0 to host localhost left intact
> [root@localhost couchdb]#
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to