tonysun83 opened a new pull request #3979:
URL: https://github.com/apache/couchdb/pull/3979


   ## Overview
   
   Under heavy load, fabric_update_doc workers will return `timeout` via
   rexi. Therefore no responses will populate the response dictionary.
   This leads to `badargs` when we do `dict:fetch` for keys that do not exist.
   This checks for the existence of the key and then returns undefined
   if it does not exist, which aligns with the same code path of when we
   the number of docs < 100.
   
   In this solution, we're masking the fact that workers failed their updates. 
`handle_message`
   is never called since no workers return. The returned `Health` value is 
actually `ok`. It solves
   the badargs but we need to consider a correct response. I don't think 200 is 
correct.
   
   1) We can return `{error,...}` and also change it for < 100 docs. Possible 
Breaking change.
   2) We can return `{error,...}` for only > 100 docs. But this could lead to 
different results.
   3) We can return `{accepted...}` when Results are not empty, and `error` 
only when results is 
   completely empty.
   
   
   ## Testing recommendations
   
   Run https://gist.github.com/nickva/bde7d3cfa8c9df0dd18700c661fec4ab
   with
   ```
   python stampede.py -x 100 -w 5
   ```
   should not create badargs.
   
   ## Related Issues or Pull Requests
   
   https://github.com/apache/couchdb/issues/3948
   
   
   ## Checklist
   
   - [ ] Code is written and works correctly
   - [ ] Changes are covered by tests
   - [ ] Any new configurable parameters are documented in 
`rel/overlay/etc/default.ini`
   - [ ] 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