rnewson opened a new pull request, #5371: URL: https://github.com/apache/couchdb/pull/5371
## Overview CouchDB issues all write requests in parallel without coordination, applying a quorum on the results of those independent actions. When updating a document concurrently this can lead to the introduction of a stored conflict if two different writes reach separate nodes first. This is undesirable. This patch changes fabric_doc_update in the following ways; 1. Workers are no longer started immediately, but are given a unique reference each. 2. For each range in the write request, one node is chosen to "lead" the write decision (calculated as the lowest live node that hosts the shard range) 3. "Leader" workers are started. 4. Any doc update that receives "conflict" from a Leader is added to the reply dict W times and the doc updates are removed from the other (unstarted) workers. If that leaves the worker with nothing to do, it is removed entirely. ## Testing recommendations There is some existing coverage in the module itself but more testing is needed before this can be merged. ## Related Issues or Pull Requests ## Checklist - [x] Code is written and works correctly - [ ] Changes are covered by tests - [ ] Any new configurable parameters are documented in `rel/overlay/etc/default.ini` - [ ] Documentation changes were made in the `src/docs` folder - [ ] Documentation changes were backported (separated PR) to affected branches -- 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]
