You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Paul Freet <pf...@gmail.com> on 2011/02/23 00:35:12 UTC

Explanation for Couchdb crash when using _sum reduce?

Any thoughts what is causing this?  Happens when I am pulling up the 
View in Futon. Javascript is nothing complicated:

Map function:
function(doc) {
    var key;
    if (doc.item && doc.timestamp) {
       for (var i in doc.item) {
          key = [doc.item[i]["sku"], doc.timestamp];
          emit(key,Number(doc.item[i]["price"]));
       };
    };
};

Reduce function:
_sum

Only 11 documents. Works with _count. Now it just crashes. Using 0.11.2 
on CentoOS5.


[Tue, 22 Feb 2011 23:06:11 GMT] [error] [<0.23173.1>]
{error_report,<0.29.0>,
     {<0.23173.1>,crash_report,
      [[{pid,<0.23173.1>},
        {registered_name,[]},
        {error_info,
            {error,badarg,
                [{erlang,list_to_binary,
                     [[{couch_query_servers,builtin_reduce,
                           [reduce,
                            [<<"_sum\n">>],
                            [[[[<<"1149">>,<<"2011-01-29">>],
                               <<"5e5b60270ff1cd7226b6690a00961d48">>],
                              0.43],
                             [[[<<"1167">>,<<"2011-01-29">>],
                               <<"5e5b60270ff1cd7226b6690a00961d48">>],
                              2.72],
                             [[[<<"1203">>,<<"2011-01-29">>],
                               <<"5e5b60270ff1cd7226b6690a00961d48">>],
                              2.89],
                             [[[<<"1245">>,<<"2011-01-29">>],
                               <<"5e5b60270ff1cd7226b6690a00961d48">>],
                              6.73],
                             [[[<<"1255">>,<<"2011-01-29">>],
                               <<"5e5b60270ff1cd7226b6690a00961d48">>],
                              3.5],
                             [[[<<"1323">>,<<"2011-01-29">>],
                               <<"5e5b60270ff1cd7226b6690a00961d48">>],
                              4.99],
                             [[[<<"1347">>,<<"2011-01-29">>],
                               <<"5e5b60270ff1cd7226b6690a00961d48">>],
                              7.03]],
                            []]},
                       {couch_query_servers,reduce,3},
                       {couch_view_group,'-init_group/4-fun-0-',4},
                       {couch_btree,'-write_node/3-lc$^0/1-0-',3},
                       {couch_btree,write_node,3},
                       {couch_btree,modify_node,4},
                       {couch_btree,query_modify,4},
                       {couch_btree,add_remove,3}]]},
                 {couch_httpd,error_info,1},
                 {couch_httpd,send_error,2},
                 {couch_httpd,handle_request_int,5},
                 {mochiweb_http,headers,5},
                 {proc_lib,init_p_do_apply,3}]}},
        {initial_call,
            {mochiweb_acceptor,init,
                ['Argument__1','Argument__2','Argument__3']}},
        {ancestors,

[couch_httpd,couch_secondary_services,couch_server_sup,<0.30.0>]},
        {messages,[]},
        {links,[<0.93.0>,#Port<0.59100>]},
        {dictionary,
            [{mochiweb_request_qs,
                 [{"limit","11"},{"descending","true"},{"reduce","false"}]},
             {mochiweb_request_cookie,[]}]},
        {trap_exit,false},
        {status,running},
        {heap_size,4181},
        {stack_size,23},
        {reductions,23686}],
       []]}}