You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Chris Anderson (JIRA)" <ji...@apache.org> on 2008/06/23 08:04:45 UTC

[jira] Created: (COUCHDB-84) Reduce with group=true and count set to less than the # of returned rows, fails to close the json array

Reduce with group=true and count set to less than the # of returned rows, fails to close the json array
-------------------------------------------------------------------------------------------------------

                 Key: COUCHDB-84
                 URL: https://issues.apache.org/jira/browse/COUCHDB-84
             Project: CouchDB
          Issue Type: Bug
          Components: HTTP Interface
    Affects Versions: 0.8
            Reporter: Chris Anderson


Running a request with group=true and a count which limits the amount of rows returned, results in invalid JSON (and a 500 error being logged by CouchDB). The problems has been reproduced in a test case attached to this ticket.

The fix may be a little iffy (I changed some code that was probably like it was for a reason...) so please review before applying the patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (COUCHDB-84) Reduce with group=true and count set to less than the # of returned rows, fails to close the json array

Posted by "Damien Katz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-84?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Damien Katz closed COUCHDB-84.
------------------------------

    Assignee: Damien Katz  (was: Christopher Lenz)

Fixed in trunk in 680796. Used an approach similar to the last proposed fix, but with the "try catch" happening in the btree code. This fix probably won't make in into 0.8.1, but its not critical.

> Reduce with group=true and count set to less than the # of returned rows, fails to close the json array
> -------------------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-84
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-84
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 0.8
>            Reporter: Chris Anderson
>            Assignee: Damien Katz
>             Fix For: 0.8.1
>
>         Attachments: group_view_count.diff, missing_json_end.diff
>
>
> Running a request with group=true and a count which limits the amount of rows returned, results in invalid JSON (and a 500 error being logged by CouchDB). The problems has been reproduced in a test case attached to this ticket.
> The fix may be a little iffy (I changed some code that was probably like it was for a reason...) so please review before applying the patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (COUCHDB-84) Reduce with group=true and count set to less than the # of returned rows, fails to close the json array

Posted by "Christopher Lenz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-84?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christopher Lenz reassigned COUCHDB-84:
---------------------------------------

    Assignee: Christopher Lenz

> Reduce with group=true and count set to less than the # of returned rows, fails to close the json array
> -------------------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-84
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-84
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 0.8
>            Reporter: Chris Anderson
>            Assignee: Christopher Lenz
>             Fix For: 0.8.1
>
>         Attachments: missing_json_end.diff
>
>
> Running a request with group=true and a count which limits the amount of rows returned, results in invalid JSON (and a 500 error being logged by CouchDB). The problems has been reproduced in a test case attached to this ticket.
> The fix may be a little iffy (I changed some code that was probably like it was for a reason...) so please review before applying the patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (COUCHDB-84) Reduce with group=true and count set to less than the # of returned rows, fails to close the json array

Posted by "Chris Anderson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-84?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Anderson reopened COUCHDB-84:
-----------------------------------


The old fix continues to calculate the group reduce view long after the count has been reached. This new patch makes these queries MUCH faster, as well as fixing a potential invalid JSON response on very large data sets.

> Reduce with group=true and count set to less than the # of returned rows, fails to close the json array
> -------------------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-84
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-84
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 0.8
>            Reporter: Chris Anderson
>            Assignee: Christopher Lenz
>             Fix For: 0.8.1
>
>         Attachments: missing_json_end.diff
>
>
> Running a request with group=true and a count which limits the amount of rows returned, results in invalid JSON (and a 500 error being logged by CouchDB). The problems has been reproduced in a test case attached to this ticket.
> The fix may be a little iffy (I changed some code that was probably like it was for a reason...) so please review before applying the patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (COUCHDB-84) Reduce with group=true and count set to less than the # of returned rows, fails to close the json array

Posted by "Christopher Lenz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-84?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christopher Lenz resolved COUCHDB-84.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 0.8.1

Patch applied in r670774. Thanks!

> Reduce with group=true and count set to less than the # of returned rows, fails to close the json array
> -------------------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-84
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-84
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 0.8
>            Reporter: Chris Anderson
>            Assignee: Christopher Lenz
>             Fix For: 0.8.1
>
>         Attachments: missing_json_end.diff
>
>
> Running a request with group=true and a count which limits the amount of rows returned, results in invalid JSON (and a 500 error being logged by CouchDB). The problems has been reproduced in a test case attached to this ticket.
> The fix may be a little iffy (I changed some code that was probably like it was for a reason...) so please review before applying the patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-84) Reduce with group=true and count set to less than the # of returned rows, fails to close the json array

Posted by "Chris Anderson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-84?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Anderson updated COUCHDB-84:
----------------------------------

    Attachment: group_view_count.diff

This patch works with couch_btree's throw() to catch the view generation, so that valid JSON is produced and the function isn't run across the entire data set.

> Reduce with group=true and count set to less than the # of returned rows, fails to close the json array
> -------------------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-84
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-84
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 0.8
>            Reporter: Chris Anderson
>            Assignee: Christopher Lenz
>             Fix For: 0.8.1
>
>         Attachments: group_view_count.diff, missing_json_end.diff
>
>
> Running a request with group=true and a count which limits the amount of rows returned, results in invalid JSON (and a 500 error being logged by CouchDB). The problems has been reproduced in a test case attached to this ticket.
> The fix may be a little iffy (I changed some code that was probably like it was for a reason...) so please review before applying the patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-84) Reduce with group=true and count set to less than the # of returned rows, fails to close the json array

Posted by "Christopher Lenz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-84?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12617041#action_12617041 ] 

Christopher Lenz commented on COUCHDB-84:
-----------------------------------------

Is that test case you added supposed to fail without the patch? It seems to be working okay for me.

> Reduce with group=true and count set to less than the # of returned rows, fails to close the json array
> -------------------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-84
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-84
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 0.8
>            Reporter: Chris Anderson
>            Assignee: Christopher Lenz
>             Fix For: 0.8.1
>
>         Attachments: group_view_count.diff, missing_json_end.diff
>
>
> Running a request with group=true and a count which limits the amount of rows returned, results in invalid JSON (and a 500 error being logged by CouchDB). The problems has been reproduced in a test case attached to this ticket.
> The fix may be a little iffy (I changed some code that was probably like it was for a reason...) so please review before applying the patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-84) Reduce with group=true and count set to less than the # of returned rows, fails to close the json array

Posted by "Chris Anderson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-84?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607247#action_12607247 ] 

Chris Anderson commented on COUCHDB-84:
---------------------------------------

I'm afraid my fix for the invalid JSON bug might lead to CouchDB calculating the group=true results for the whole view, even it it only returns n = count of them. I've noticed that the fix, while it works in against the test suite, doesn't stay fixed when the data set is large.

> Reduce with group=true and count set to less than the # of returned rows, fails to close the json array
> -------------------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-84
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-84
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 0.8
>            Reporter: Chris Anderson
>         Attachments: missing_json_end.diff
>
>
> Running a request with group=true and a count which limits the amount of rows returned, results in invalid JSON (and a 500 error being logged by CouchDB). The problems has been reproduced in a test case attached to this ticket.
> The fix may be a little iffy (I changed some code that was probably like it was for a reason...) so please review before applying the patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (COUCHDB-84) Reduce with group=true and count set to less than the # of returned rows, fails to close the json array

Posted by "Christopher Lenz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-84?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christopher Lenz resolved COUCHDB-84.
-------------------------------------

    Resolution: Fixed

Can you please file this second problem as a new issue? We'd like to get 0.8.1 out without this patch, but seeing how the first patch has been integrated and merged...

> Reduce with group=true and count set to less than the # of returned rows, fails to close the json array
> -------------------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-84
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-84
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 0.8
>            Reporter: Chris Anderson
>            Assignee: Christopher Lenz
>             Fix For: 0.8.1
>
>         Attachments: group_view_count.diff, missing_json_end.diff
>
>
> Running a request with group=true and a count which limits the amount of rows returned, results in invalid JSON (and a 500 error being logged by CouchDB). The problems has been reproduced in a test case attached to this ticket.
> The fix may be a little iffy (I changed some code that was probably like it was for a reason...) so please review before applying the patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-84) Reduce with group=true and count set to less than the # of returned rows, fails to close the json array

Posted by "Chris Anderson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-84?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Anderson updated COUCHDB-84:
----------------------------------

    Attachment: missing_json_end.diff

> Reduce with group=true and count set to less than the # of returned rows, fails to close the json array
> -------------------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-84
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-84
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 0.8
>            Reporter: Chris Anderson
>         Attachments: missing_json_end.diff
>
>
> Running a request with group=true and a count which limits the amount of rows returned, results in invalid JSON (and a 500 error being logged by CouchDB). The problems has been reproduced in a test case attached to this ticket.
> The fix may be a little iffy (I changed some code that was probably like it was for a reason...) so please review before applying the patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.