Hi, The code is definitive:
https://github.com/apache/couchdb/blob/604526f5f93df28138a165a666e39ff37f3fdc06/src/mem3/src/mem3.erl#L391 n(DbName) div 2 + 1; That is, (N/2) + 1, where (N/2) is rounded down to nearest integer. For odd numbers of N (the only kind we recommend) the doc formulation is equivalent due to rounding. However, we will amend the documentation as it is wrong for even numbers (because of the lack of rounding). Thanks for bringing this to our attention. B. > On 10 Jun 2023, at 13:05, Luca Morandini <[email protected]> wrote: > > Folks, > > The doc states that the formula to get the write and read quorum is: > The default required size of a quorum is equal to r=w=((n+1)/2) > https://docs.couchdb.org/en/stable/cluster/sharding.html#quorum > > However, the code suggests otherwise: > WR = N div 2 + 1, > https://github.com/apache/couchdb/blob/604526 > f5f93df28138a165a666e39ff37f3fdc06/src/fabric/src/fabric_db_info.erl#L159 > > Am I missing something? > > Cheers, > > Luca Morandini
