Skip to content

Support dynamic evaluation of synchronous replication quorum #1730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tracked by #2601
TarantoolBot opened this issue Dec 24, 2020 · 3 comments · Fixed by #3133
Closed
Tracked by #2601

Support dynamic evaluation of synchronous replication quorum #1730

TarantoolBot opened this issue Dec 24, 2020 · 3 comments · Fixed by #3133
Assignees
Labels
feature A new functionality reference [location] Tarantool manual, Reference part server [area] Task relates to Tarantool's server (core) functionality

Comments

@TarantoolBot
Copy link
Collaborator

TarantoolBot commented Dec 24, 2020

Support dynamic evaluation of synchronous replication quorum

Product: Tarantool
Since: 2.5.3, 2.6.2, 2.7.1
Audience/target:
Root document:

Details

Setting replication_synchro_quorum option to an explicit integer
value was introduced rather for simplicity sake mostly. For example
if the cluster's size is not a constant value and new replicas are
connected in dynamically then an administrator might need to increase
the option by hands or by some other external tool.

Instead one can use a dynamic evaluation of a quorum value via formal
representation using symbol N as a current number of registered replicas
in a cluster.

For example, the canonical definition for a quorum (that is, majority
of members in a set) of N replicas is N/2+1. For such configuration
define

box.cfg {replication_synchro_quorum = "N/2+1"}

The formal statement allows to provide a flexible configuration but keep
in mind that only canonical quorum (and bigger values, say N for all
replicas) guarantees data reliability and various weird forms such as
N/3+1 while allowed may lead to unexpected results.
Requested by @cyrillos in tarantool/tarantool@14fa5fd.

See other details in the issue comments below.

@Totktonada
Copy link
Member

The division gives an integral result? The rounding is to a lower integral number / to zero / to a nearest integral value?

Or, if the division is floating point / exact decimal, whether the result of expression is rounded? If so, how exactly?

@cyrillos
Copy link

It simply returns the formula evaluated, we don't even care much what exactly a user has passed. The result is treated as an integer number.
tarantool/tarantool@14fa5fd#diff-fc276b44b551b4eac3431c9433d4bc881790ddd7df76226d7579f80da7798f6eR566

@cyrillos
Copy link

If result is out of range the error is returned

	if (quorum <= 0 || quorum >= VCLOCK_MAX) {
		const char *msg =
			tt_sprintf("the formula is evaluated "
				   "to the quorum %d for replica "
				   "number %d, which is out of range "
				   "[%d;%d]",
				   quorum, nr_replicas, 1, VCLOCK_MAX - 1);
		diag_set(ClientError, ER_CFG,
			 "replication_synchro_quorum", msg);
		return -1;
	}

@Onvember Onvember added feature A new functionality reference [location] Tarantool manual, Reference part S (small) labels Feb 11, 2021
@Onvember Onvember changed the title Support dynamic evaluation of synchronous replication quorum [10pt] Support dynamic evaluation of synchronous replication quorum Feb 12, 2021
@veod32 veod32 added 2.7.1 feature A new functionality server [area] Task relates to Tarantool's server (core) functionality and removed feature A new functionality S (small) labels Mar 18, 2021
@veod32 veod32 changed the title [10pt] Support dynamic evaluation of synchronous replication quorum [2pt] Support dynamic evaluation of synchronous replication quorum Mar 18, 2021
@veod32 veod32 added this to the Tarantool releases of Dec 2020 milestone Mar 22, 2021
@art-dr art-dr added the 2sp label Jan 26, 2022
@art-dr art-dr changed the title [2pt] Support dynamic evaluation of synchronous replication quorum Support dynamic evaluation of synchronous replication quorum Jan 26, 2022
@veod32 veod32 removed this from the Tarantool Releases: 2020 Q4 milestone May 6, 2022
xuniq added a commit that referenced this issue Sep 12, 2022
Resolves #1730 
* Add info about dynamic evaluation
* Update translation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality reference [location] Tarantool manual, Reference part server [area] Task relates to Tarantool's server (core) functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants