You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by iilyak <gi...@git.apache.org> on 2015/04/29 21:21:39 UTC

[GitHub] couchdb-couch-mrview pull request: 2650 etag fixes

GitHub user iilyak opened a pull request:

    https://github.com/apache/couchdb-couch-mrview/pull/18

    2650 etag fixes

    Depends on https://github.com/apache/couchdb-chttpd/pull/34

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

    $ git pull https://github.com/iilyak/couchdb-couch-mrview 2650-etag-fixes

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

    https://github.com/apache/couchdb-couch-mrview/pull/18.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 #18
    
----
commit 9cad781380d0b188ed8f2caab4445e4fac322fd4
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Date:   2015-04-29T18:45:17Z

    Don't append Etag if undefined
    
    COUCHDB-2650

commit 642553e1d416e4b72123b6e9f6e14a6a633f7a91
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Date:   2015-04-29T18:55:40Z

    Use chttpd:make_etag/0
    
    COUCHDB-2650

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-mrview pull request: 2650 etag fixes

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak commented on a diff in the pull request:

    https://github.com/apache/couchdb-couch-mrview/pull/18#discussion_r30819415
  
    --- Diff: src/couch_mrview_util.erl ---
    @@ -1016,3 +1019,26 @@ get_view_queries({Props}) ->
             _ ->
                 throw({bad_request, "`queries` member must be a array."})
         end.
    +
    +maybe_etag_respond(Req, Meta, undefined) ->
    +    undefined;
    +maybe_etag_respond(Req, Meta, PartialEtag) ->
    +    {MetaTerm, _Rest} = proplists:split(Meta, [total, offset, update_seq]),
    --- End diff --
    
    Good catch. I'll try something different.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-mrview pull request: 2650 etag fixes

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak closed the pull request at:

    https://github.com/apache/couchdb-couch-mrview/pull/18


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-mrview pull request: 2650 etag fixes

Posted by davisp <gi...@git.apache.org>.
Github user davisp commented on a diff in the pull request:

    https://github.com/apache/couchdb-couch-mrview/pull/18#discussion_r30815269
  
    --- Diff: src/couch_mrview_util.erl ---
    @@ -1016,3 +1019,26 @@ get_view_queries({Props}) ->
             _ ->
                 throw({bad_request, "`queries` member must be a array."})
         end.
    +
    +maybe_etag_respond(Req, Meta, undefined) ->
    +    undefined;
    +maybe_etag_respond(Req, Meta, PartialEtag) ->
    +    {MetaTerm, _Rest} = proplists:split(Meta, [total, offset, update_seq]),
    --- End diff --
    
    Unless I'm mistaken, for single node requests (ie, 5986) the update_seq only comes back when requested by the client [1] and in the clustered case it never comes back [2].
    
    Thus unless you're in a very specific case (you requested update_seq=true on 5986) then this ETag generation will fail to properly invalidate a response when a database has been changed.
    
    [1] https://github.com/apache/couchdb-couch-mrview/blob/master/src/couch_mrview.erl#L526-L530
    [2] https://github.com/apache/couchdb-fabric/blob/master/src/fabric_view_all_docs.erl#L148


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-mrview pull request: 2650 etag fixes

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak commented on the pull request:

    https://github.com/apache/couchdb-couch-mrview/pull/18#issuecomment-105229575
  
    As Paul mentioned the approach will not work.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-mrview pull request: 2650 etag fixes

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak commented on the pull request:

    https://github.com/apache/couchdb-couch-mrview/pull/18#issuecomment-104314559
  
    Depends on https://github.com/apache/couchdb-couch/pull/51


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-mrview pull request: 2650 etag fixes

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak commented on the pull request:

    https://github.com/apache/couchdb-couch-mrview/pull/18#issuecomment-104314536
  
    Additional commits are pushed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---