feat: Support custom replication_num for downstream cluster #649
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.
背景
备份集群通常出于成本考虑,副本数会比源集群要少。例如生产环境使用 3 副本保证高可用,而备份环境只需 1-2 副本即可满足灾备需求。当前 CCR 默认继承上游副本数设置,导致备份集群资源浪费。
改动说明
新增
replication_num参数支持自定义下游集群副本数策略。实现方式
replication_num字段-1:继承上游副本数(默认行为,使用reserve_replica=true)>0:强制使用固定副本数(如1表示单副本)0:无效值,创建时报错replication_allocation)feature_override_replication_num(默认开启)控制该功能使用示例
NOTE
AddPartition:BInlog-data中没有包含副本数信息,没有改动,使用默认副本数。ModifyPartition: 暂时未支持。