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


   In a rare, unsupported scenario, a user can call _bulk_docs with
   new_edits:false and a VDU that denies the update of certain documents.
   When nodes are out of sync (under load and mem3_repl can't keep up),
   an update may or may not update the revision tree.
   
   When two nodes extend the revision tree and forbids the update,
   but one node is behind, an {error, W, [{Doc, FirstReply} | Acc]}
   is returned instead of {ok, _} or {accepted, _}. The _bulk_docs
   request does not accept {error, _} which leads to a function_clause.
   
   This fix changes the return value to:
   {accepted, W, [{Doc, {forbidden, Msg}} | Acc]}
   when any of the nodes forbids the update.
   
   Updating one document is also addressed so if the same issue occurs
   during one document update, a 403 is still returned.
   
   This should not affect replication since replication understands
   forbidden return values and should ignore the update respectively.
   
   <!-- Thank you for your contribution!
   
        Please file this form by replacing the Markdown comments
        with your text. If a section needs no action - remove it.
   
        Also remember, that CouchDB uses the Review-Then-Commit (RTC) model
        of code collaboration. Positive feedback is represented +1 from 
committers
        and negative is a -1. The -1 also means veto, and needs to be addressed
        to proceed. Once there are no objections, the PR can be merged by a
        CouchDB committer.
   
        See: http://couchdb.apache.org/bylaws.html#decisions for more info. -->
   
   ## Overview
   
   <!-- Please give a short brief for the pull request,
        what problem it solves or how it makes things better. -->
   
   ## Testing recommendations
   
   <!-- Describe how we can test your changes.
        Does it provides any behaviour that the end users
        could notice? -->
   
   ## Related Issues or Pull Requests
   
   <!-- If your changes affects multiple components in different
        repositories please put links to those issues or pull requests here.  
-->
   
   ## 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