zachlankton opened a new pull request, #4152:
URL: https://github.com/apache/couchdb/pull/4152

   ## Overview
   
   This PR addresses a bug that is described in issue #2496 where posting an 
all docs query to a partition endpoint with keys that are not a part of the 
partition also gets returned.
   
   ## Testing recommendations
   
   Consider the following documents, each in their own partition on a database 
named `test`.
   
   ```json
   "rows": [
           {
               "id": "part1:doc1",
               "key": "part1:doc1",
               "value": {
                   "rev": "5-aa9d2b82de6db1e61fba8e4057299d21"
               }
           },
           {
               "id": "part2:doc1",
               "key": "part2:doc1",
               "value": {
                   "rev": "3-a707bb62c86bd430389e4d596aeb6084"
               }
           }
   ]
   ```
   
   When we run the following query against the `part2` partition:
   
   ```bash
   curl -X POST http://127.0.0.1:15984/test/_partition/part2/_all_docs \
       -H 'Content-Type: application/json' \
       -d '{"keys":["part1:doc1", "part2:doc1"]}'
   ```
   
   We get **_both documents from both partitions_**, but what we expect should 
look like this
   
   ```json
   "rows": [
           {
               "key": "part1:doc1",
               "error": "not_found"
           },
           {
           "id": "part2:doc1",
               "key": "part2:doc1",
               "value": {
                   "rev": "3-a707bb62c86bd430389e4d596aeb6084"
               }
          }
       ]
   ```
   
   The code in this PR fixes this issue and returns the results we expect.
   
   ## Related Issues or Pull Requests
   
   Issue #2496 
   
   ## Checklist
   
   - [x] Code is written and works correctly
   - [x] Changes are covered by tests
   - [n/a] Any new configurable parameters are documented in 
`rel/overlay/etc/default.ini`
   - [n/a] A PR for documentation changes has been made in 
https://github.com/apache/couchdb-documentation
   


-- 
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