Suggested edit to make clear what a quorum actually represents.#252
Conversation
flimzy
left a comment
There was a problem hiding this comment.
I applaud the attempt at clarity. Unfortunately, the edit isn't very clear to me--the first paragraph in particular.
| 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 document plus one *in the current partition*. That is, if there is a network |
There was a problem hiding this comment.
"partition" is not a word common to CouchDB parlance. Do you mean node? shard?
There was a problem hiding this comment.
I was trying to describe a network partition. Specifically, here I'm trying to say that if there's a network partition then the quorum is relative to only the subset of nodes on the side of the partition where the client is.
Definitely open to different wording if this is confusing.
There was a problem hiding this comment.
Ah, now I see what you're getting at. That is an important point. And the paragraph was already a bit confusing before your addition. Perhaps a rewrite of the entire section is in order.
Example:
In clustered operation, a quorum must be reached before CouchDB returns a
200for a fetch, or201for a write operation. A quorum is defined one plus half the number of copies.
For read operations, the maximum number of copies is the number of currently-accessible nodes, meaning that in the case of a failure or network partition, the effective number of copies may be lower. The number of read copies can be set with the
rparameter.
For write operations, the number of copies can be set using the
wparameter. If fewer than this number of nodes is available, a202will be returned.
There was a problem hiding this comment.
Overall I like what you have better. Will start with that but make a few changes to be more explicit. Updated PR coming soon...
| The number of nodes that need to save a document before a write is returned with | ||
| ``201`` is also equal to half of the total copies of the document plus one. | ||
| However, unlike the read case, for writes this is computed for the database as a | ||
| whole, even if there is a network partition. If there are less nodes than that |
There was a problem hiding this comment.
"less" -> "fewer" to satisfy the grammar nazis
|
Thanks for the review @flimzy . Made the obvious grammar fix. Not entirely sure how to fix the 1st paragraph. Would love suggestions. |
|
OK. Ready for re-review. Thanks @flimzy |
flimzy
left a comment
There was a problem hiding this comment.
I like this wording much better! Well done. Just a few minor fixes remaining.
| 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. | ||
| In clustered operation, a quorum must be reached before CouchDB returns a 200 | ||
| for a fetch, or 201 for a write operation. A quorum is defined one plus half the |
| 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. | ||
| In clustered operation, a quorum must be reached before CouchDB returns a 200 |
There was a problem hiding this comment.
Probably good idea to wrap status codes with tick marks as before:
``200``
vs
200
| set with the rparameter. | ||
|
|
||
| For write operations the number of relevant copies is always `n`, the number of | ||
| replicas in teh cluster. For write operations, the number of copies can be set |
|
All fixed. Thanks for the review. |
|
+1 |
|
@flimzy what's your process? Do you do the merge or should I do that? Thanks again for the review. |
|
Hey @flimzy thanks again for your review here. I noticed the live docs haven't changed yet (http://docs.couchdb.org/en/2.1.1/cluster/theory.html). I kinda thought when this was merged the docs would auto-update. Is that not the case? |
|
Hi @oliverdain , The documentation for a specific release (such as 2.1.1) are invariant; they are tagged at the time of the official Apache CouchDB release and updates cannot be made. You can see your updates here: http://docs.couchdb.org/en/master/cluster/theory.html In addition, the next release of CouchDB (2.2.0) will include your changes. This release is Very Soon Now(tm). Thanks again for your contribution! |
Overview
I found the documentation about read and write quorums for a cluster mode DB confusing. I think this edit makes things a bit more clear (though I don't love the wording).
This came from a Slack conversation which you can find here if curious: https://couchdb.slack.com/archives/C49LEE7NW/p1519761842000347