You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by mi...@free.fr on 2010/10/10 09:37:17 UTC

design doc weakness (one view fails = all views fail)

Hello couchers,

it seems that, on a design document, if there is one view having an error ( for example "Expression does not eval to a function" ) than all other views are then unusable.
It's not critical and not a real bug, but from my point of view it's a weakness : one error on one part of the design doc leads to a totally broken app / couchapp.

Steps to reproduce : 

1/ create a new database
2/ Create a design doc :


{
   "_id": "_design/doc1",
   "views": {
       "v1": {
           "map": "function() {}"
       },
       "v2": {
           "map": "thefunction() {}"
       }
   },
   "language": "javascript"
}

3/ Create a doc :

{
   "_id": "doc1"
}

4/ Call the "v1" view

What's your opinion on this ? Is it worth creating a Jira bug ?

Regards,

Mickael

Re: design doc weakness (one view fails = all views fail)

Posted by Sebastian Cohnen <se...@googlemail.com>.
exactly :)

Von unterwegs gesendet

Am 10.10.2010 um 14:22 schrieb Patrick Barnes <mr...@gmail.com>:

> Yes it does, all views of a design doc update at once.
> If you have some views that are not often needed, but are very expensive to generate, it can be better to put them in another design doc.
> 
> On 10/10/2010 11:08 PM, mickael.bailly@free.fr wrote:
>> That's interesting. For my personnal curiosity: because CouchDB update views on read, do you know if that means that, when I ask for one view, the other views of the same design documents are updated too ?
>> 
>> 
>> ----- Mail Original -----
>> De: "Sebastian Cohnen"<se...@googlemail.com>
>> À: user@couchdb.apache.org
>> Envoyé: Dimanche 10 Octobre 2010 11h43:57 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
>> Objet: Re: design doc weakness (one view fails = all views fail)
>> 
>> Hey Mickael,
>> 
>> views are processed in together groups (one per design document). this "weakness" is - AFAIK - not really avoidable in the current architecture.
>> 
>> On 10.10.2010, at 09:37, mickael.bailly@free.fr wrote:
>> 
>>> 
>>> Hello couchers,
>>> 
>>> it seems that, on a design document, if there is one view having an error ( for example "Expression does not eval to a function" ) than all other views are then unusable.
>>> It's not critical and not a real bug, but from my point of view it's a weakness : one error on one part of the design doc leads to a totally broken app / couchapp.
>>> 
>>> Steps to reproduce :
>>> 
>>> 1/ create a new database
>>> 2/ Create a design doc :
>>> 
>>> 
>>> {
>>>   "_id": "_design/doc1",
>>>   "views": {
>>>       "v1": {
>>>           "map": "function() {}"
>>>       },
>>>       "v2": {
>>>           "map": "thefunction() {}"
>>>       }
>>>   },
>>>   "language": "javascript"
>>> }
>>> 
>>> 3/ Create a doc :
>>> 
>>> {
>>>   "_id": "doc1"
>>> }
>>> 
>>> 4/ Call the "v1" view
>>> 
>>> What's your opinion on this ? Is it worth creating a Jira bug ?
>>> 
>>> Regards,
>>> 
>>> Mickael
>> 
>> 

Re: design doc weakness (one view fails = all views fail)

Posted by Patrick Barnes <mr...@gmail.com>.
Yes it does, all views of a design doc update at once.
If you have some views that are not often needed, but are very expensive 
to generate, it can be better to put them in another design doc.

On 10/10/2010 11:08 PM, mickael.bailly@free.fr wrote:
> That's interesting. For my personnal curiosity: because CouchDB update views on read, do you know if that means that, when I ask for one view, the other views of the same design documents are updated too ?
>
>
> ----- Mail Original -----
> De: "Sebastian Cohnen"<se...@googlemail.com>
> À: user@couchdb.apache.org
> Envoyé: Dimanche 10 Octobre 2010 11h43:57 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
> Objet: Re: design doc weakness (one view fails = all views fail)
>
> Hey Mickael,
>
> views are processed in together groups (one per design document). this "weakness" is - AFAIK - not really avoidable in the current architecture.
>
> On 10.10.2010, at 09:37, mickael.bailly@free.fr wrote:
>
>>
>> Hello couchers,
>>
>> it seems that, on a design document, if there is one view having an error ( for example "Expression does not eval to a function" ) than all other views are then unusable.
>> It's not critical and not a real bug, but from my point of view it's a weakness : one error on one part of the design doc leads to a totally broken app / couchapp.
>>
>> Steps to reproduce :
>>
>> 1/ create a new database
>> 2/ Create a design doc :
>>
>>
>> {
>>    "_id": "_design/doc1",
>>    "views": {
>>        "v1": {
>>            "map": "function() {}"
>>        },
>>        "v2": {
>>            "map": "thefunction() {}"
>>        }
>>    },
>>    "language": "javascript"
>> }
>>
>> 3/ Create a doc :
>>
>> {
>>    "_id": "doc1"
>> }
>>
>> 4/ Call the "v1" view
>>
>> What's your opinion on this ? Is it worth creating a Jira bug ?
>>
>> Regards,
>>
>> Mickael
>
>

Re: design doc weakness (one view fails = all views fail)

Posted by mi...@free.fr.
That's interesting. For my personnal curiosity: because CouchDB update views on read, do you know if that means that, when I ask for one view, the other views of the same design documents are updated too ?


----- Mail Original -----
De: "Sebastian Cohnen" <se...@googlemail.com>
À: user@couchdb.apache.org
Envoyé: Dimanche 10 Octobre 2010 11h43:57 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
Objet: Re: design doc weakness (one view fails = all views fail)

Hey Mickael,

views are processed in together groups (one per design document). this "weakness" is - AFAIK - not really avoidable in the current architecture.

On 10.10.2010, at 09:37, mickael.bailly@free.fr wrote:

> 
> Hello couchers,
> 
> it seems that, on a design document, if there is one view having an error ( for example "Expression does not eval to a function" ) than all other views are then unusable.
> It's not critical and not a real bug, but from my point of view it's a weakness : one error on one part of the design doc leads to a totally broken app / couchapp.
> 
> Steps to reproduce : 
> 
> 1/ create a new database
> 2/ Create a design doc :
> 
> 
> {
>   "_id": "_design/doc1",
>   "views": {
>       "v1": {
>           "map": "function() {}"
>       },
>       "v2": {
>           "map": "thefunction() {}"
>       }
>   },
>   "language": "javascript"
> }
> 
> 3/ Create a doc :
> 
> {
>   "_id": "doc1"
> }
> 
> 4/ Call the "v1" view
> 
> What's your opinion on this ? Is it worth creating a Jira bug ?
> 
> Regards,
> 
> Mickael


Re: design doc weakness (one view fails = all views fail)

Posted by Sebastian Cohnen <se...@googlemail.com>.
Hey Mickael,

views are processed in together groups (one per design document). this "weakness" is - AFAIK - not really avoidable in the current architecture.

On 10.10.2010, at 09:37, mickael.bailly@free.fr wrote:

> 
> Hello couchers,
> 
> it seems that, on a design document, if there is one view having an error ( for example "Expression does not eval to a function" ) than all other views are then unusable.
> It's not critical and not a real bug, but from my point of view it's a weakness : one error on one part of the design doc leads to a totally broken app / couchapp.
> 
> Steps to reproduce : 
> 
> 1/ create a new database
> 2/ Create a design doc :
> 
> 
> {
>   "_id": "_design/doc1",
>   "views": {
>       "v1": {
>           "map": "function() {}"
>       },
>       "v2": {
>           "map": "thefunction() {}"
>       }
>   },
>   "language": "javascript"
> }
> 
> 3/ Create a doc :
> 
> {
>   "_id": "doc1"
> }
> 
> 4/ Call the "v1" view
> 
> What's your opinion on this ? Is it worth creating a Jira bug ?
> 
> Regards,
> 
> Mickael