silvpol opened a new issue #3955:
URL: https://github.com/apache/couchdb/issues/3955


   ## Description
   
   In a partitioned DB using custom reduce function doesn't work, all queries 
to that view fail with 500 error. Creating exact same view in non-partitioned 
db works. Built in reduce funtions work fine though.
   
   ## Steps to Reproduce
   
   1. Set up CouchDB cluster
   2. Create partitioned and non-partitioned DBs
   3. Apply the example view on both
   4. Try to query in both databases
   5. Swap custom reduce for _count built-in
   6. Now works on both DBs
   
   ## Expected Behaviour
   
   Custom reduce functions should work fine on partitioned DB or should be 
documented non-working
   
   ## Your Environment
   
   Docker Compose setup with three nodes using Docker Hub `couchdb:3` image
   * CouchDB version used: 3.2.1
   * Browser name and version: Postman 9.4.12
   * Operating system and version: Docker container on MacOS 10.15.7
   
   ## Additional Context
   
   Design doc:
   ````
   {
       "views": {
           "one": {
               "map": "mapfun = function (doc) {\n  if (doc.id !== \"\") {\n    
emit(doc.id, 1);\n  }\n};\n",
               "reduce": "function(keys, values, rereduce) {\n    if (rereduce) 
{\n        return sum(values);\n    } else {\n        return values.length;\n   
 }\n}"
           }
       },
       "filters": {},
       "updates": {},
       "language": "javascript",
       "options": {}
   }
   ````
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to