couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Randall Leeds (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COUCHDB-1206) View ETags may be incorrect if ?include_docs=true is specified
Date Thu, 30 Jun 2011 08:00:30 GMT

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

Randall Leeds commented on COUCHDB-1206:
----------------------------------------

Could we include the _rev and _id of the document iff it emitted a non-zero number of rows?
Then the etag wouldn't change when a document emits no rows, but would change even if the
emitted data stays the same (_rev changed). Without looking at the view code I don't know
if this is easy or reasonable, but I thought I'd mention it before you dive in.

> View ETags may be incorrect if ?include_docs=true is specified
> --------------------------------------------------------------
>
>                 Key: COUCHDB-1206
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1206
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Jens Alfke
>            Assignee: Robert Newson
>            Priority: Minor
>             Fix For: 1.1.1, 1.2
>
>
> Change COUCHDB-799 altered the way ETags are assigned to views, by having the ETag change
only when the view index changes, not when any document changes. Unfortunately this means
that a view with the "?include_docs=true" option can return an incorrect ETag. The reason
is that if a document in the view is changed, but the change doesn't affect the view index,
the result of the GET will change (it will contain the document's updated contents), but the
ETag won't. This can result in stale data if the client uses a conditional GET, because it'll
get a 304 even though the prior response is out of date.
> Robert Newson's analysis on the user@ list is "I think the sanest fix is to make view
etags for include_docs=true use the original algorithm, so that they always change if the
database changes."

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message