jjrodrig opened a new pull request #1127: Fix for issue #603 - Error 500 when creating a db below quorum URL: https://github.com/apache/couchdb/pull/1127 <!-- 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 Current behaviour of DB creation in a cluster degradated situation is not consistent with the general behaviour described for document creation in the same situation. > The number of copies of a document with the same revision that have to be read before CouchDB returns with a 200 is equal to a half of total copies of the document plus one. It is the same for the number of nodes that need to save a document before a write is returned with 201. If there are less nodes than that number, then 202 is returned. Both read and write numbers can be specified with a request as r and w parameters accordingly. The current behaviour for database creation in a cluster is: - Database creation returns 201 - Created if all nodes responds ok - Database creation returns 202 - Accepted if the quorum is met - Database creation returns 500 - Error if the responses are bellow quorum The quorum is the default: Number of nodes/2 +1 This PR changes the database creation result with the following behaviour: - Database creation returns 201 - Creation if the quorum is met - Database creation returns 202 - Accepted if at least one node responds ok - Database creation returns 500 - Error if there is no correct response from any node ## Testing recommendations - All previous tests are ok - I didn't identify testing infraestructure to test cluster degradation issues. - I've focused on chttpd and javascript tests - I've skiped reduce_builtin.js test as it is failing even in master branch `test/javascript/tests/reduce_builtin.js Error: {gen_server,call,[<0.2426.1>,{get_state,49},infinity]}` `make check apps=chttpd ignore_js_suites=reduce_builtin` ## Related Issues or Pull Requests Issue #603 ## Checklist - [x] Code is written and works correctly; - [x] Changes are covered by tests; (DB creation yes, Cluster degradation no) - [ ] Documentation reflects the changes;
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
