This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
feat(update_replication_factor#7): replace cluster-level max_replicas_in_group with max_replica_count of each replica #1109
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a subtask of apache/incubator-pegasus#865.
There is an option
max_replicas_in_group
which restricts the max replica count of the whole cluster. It's a cluster-level option. However, now that it's allowed to update the replication factor of each table, this cluster-level option should be replaced.Conceptually
max_replicas_in_group
is the total number of alive and dropped replicas. Its default value is 4. For a table that has replication factor 3, thatmax_replicas_in_group
is set to 4 means 3 alive replicas plus a dropped replica.max_replicas_in_group
can also be loaded from configuration file, which means its default value will be overridden. The value ofmax_replicas_in_group
will be assigned to another static variableMAX_REPLICA_COUNT_IN_GRROUP
, whose default value is also 4.For unit tests,
MAX_REPLICA_COUNT_IN_GRROUP
is set to the default value 4; for production environments,MAX_REPLICA_COUNT_IN_GRROUP
is set to 3 sincemax_replicas_in_group
is configured as 3 in.ini
file.Since the cluster-level option
max_replicas_in_group
contains the alive and dropped replicas, we can use the replication factor of each table as the number of alive replicas, and introduce another optionmax_reserved_dropped_replicas
representing the max reserved number allowed for dropped replicas.If
max_reserved_dropped_replicas
is set to 1, there is at most one dropped replicas reserved; If it's set to 0, however, none of dropped replicas can be reserved.Thus the default value of
max_reserved_dropped_replicas
is set to 1 to so that the unit tests can be passed.For production environments, it should be set to 0 to be consistent with
max_replicas_in_group
, which also means, once the number of alive replicas reaches max_replica_count, at most one dropped replica can be reserved and others will be eliminated.[meta_server] + max_reserved_dropped_replicas = 0