mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
feat(access): no distance for crossing idc getting
. #1000573599 Signed-off-by: slasher <shenjie1@oppo.com>
This commit is contained in:
parent
8e85d22aee
commit
6518595f6e
@ -171,6 +171,8 @@ type StreamConfig struct {
|
||||
// EC24P8 in 1AZ, C(32, 8) = 10518300 matrix
|
||||
// Inverted matrix memory: (24 + 24*24 + 24*24*8) * 10518300 ~= 51 GB
|
||||
CodeModesGetOrdered map[codemode.CodeMode]bool `json:"code_mode_get_ordered"`
|
||||
// CodeModesGetIgnoreIDC no distance when getting cross idc
|
||||
CodeModesGetIgnoreIDC map[codemode.CodeMode]bool `json:"code_mode_get_ignore_idc"`
|
||||
|
||||
ClusterConfig controller.ClusterConfig `json:"cluster_config"`
|
||||
BlobnodeConfig blobnode.Config `json:"blobnode_config"`
|
||||
|
||||
@ -199,7 +199,9 @@ func (h *Handler) Get(ctx context.Context, w io.Writer, location proto.Location,
|
||||
|
||||
// do not use local shards
|
||||
ordered := h.CodeModesGetOrdered[blobVolume.CodeMode]
|
||||
sortedVuids = genSortedVuidByIDC(ctx, serviceController, h.IDC, blobVolume.Units[:tactic.N+tactic.M], ordered)
|
||||
ignoreIDC := h.CodeModesGetIgnoreIDC[blobVolume.CodeMode]
|
||||
sortedVuids = genSortedVuidByIDC(ctx,
|
||||
serviceController, h.IDC, blobVolume.Units[:tactic.N+tactic.M], ordered, ignoreIDC)
|
||||
spanpipe.Debugf("to read %s with read-shard-x:%d active-shard-n:%d of data-n:%d party-n:%d",
|
||||
blob.ID(), h.MinReadShardsX, len(sortedVuids), tactic.N, tactic.M)
|
||||
if len(sortedVuids) < tactic.N {
|
||||
@ -838,7 +840,8 @@ func genLocationBlobs(location *proto.Location, readSize uint64, offset uint64)
|
||||
}
|
||||
|
||||
func genSortedVuidByIDC(ctx context.Context,
|
||||
serviceController controller.ServiceController, idc string, vuidPhys []controller.Unit, ordered bool,
|
||||
serviceController controller.ServiceController, idc string, vuidPhys []controller.Unit,
|
||||
ordered bool, ignoreIDC bool,
|
||||
) []sortedVuid {
|
||||
span := trace.SpanFromContextSafe(ctx)
|
||||
|
||||
@ -859,7 +862,11 @@ func genSortedVuidByIDC(ctx context.Context,
|
||||
continue
|
||||
}
|
||||
|
||||
dis := distance(idc, hostIDC.IDC, hostIDC.Punished)
|
||||
destIDC := hostIDC.IDC
|
||||
if ignoreIDC {
|
||||
destIDC = idc
|
||||
}
|
||||
dis := distance(idc, destIDC, hostIDC.Punished)
|
||||
if _, ok := sortMap[dis]; !ok {
|
||||
sortMap[dis] = make([]sortedVuid, 0, 8)
|
||||
}
|
||||
|
||||
@ -50,6 +50,9 @@
|
||||
"12": true,
|
||||
"15": true
|
||||
},
|
||||
"code_mode_get_ignore_idc": {
|
||||
"14": true
|
||||
},
|
||||
"alloc_retry_interval_ms": 100,
|
||||
"alloc_retry_times": 3,
|
||||
"encoder_concurrency": 1000,
|
||||
|
||||
@ -24,6 +24,7 @@ access的配置是基于[公有配置](./base.md),以下配置说明主要针
|
||||
| mem_pool_size_classes | 文件读写内存控制 | 否 |
|
||||
| code_mode_put_quorums | 配置修改 put quorums | 否 |
|
||||
| code_mode_get_ordered | codemode 下载时保持 shards 顺序 | 否 |
|
||||
| code_mode_get_ignore_idc | codemode 下载时忽略idc之间距离 | 否 |
|
||||
| encoder_concurrency | EC编解码并发数 | 否,默认1000 |
|
||||
| encoder_enableverify | EC编解码是否启用验证 | 否,默认开启 |
|
||||
| min_read_shards_x | EC读取并发多下载几个shards | 否,默认1,越大容错率越高,但带宽也越高 |
|
||||
@ -178,6 +179,9 @@ v3.2.1版本开始支持`health_port`
|
||||
"12": true,
|
||||
"15": true
|
||||
},
|
||||
"code_mode_get_ignore_idc": {
|
||||
"14": true
|
||||
},
|
||||
"alloc_retry_times": 3,
|
||||
"alloc_retry_interval_ms": 100,
|
||||
"encoder_concurrency": 1000,
|
||||
|
||||
@ -24,6 +24,7 @@ Access configuration is based on the [public configuration](./base.md), and the
|
||||
| mem_pool_size_classes | Memory control for file read/write | No |
|
||||
| code_mode_put_quorums | Reset codemode put quorum | No |
|
||||
| code_mode_get_ordered | Config codemode get shards with order | No |
|
||||
| code_mode_get_ignore_idc | Config codemode get shards ignore idc distance | No |
|
||||
| encoder_concurrency | EC encoding/decoding concurrency | No, default is 1000 |
|
||||
| encoder_enableverify | Whether to enable EC encoding/decoding verification | No, default is enabled |
|
||||
| min_read_shards_x | Number of shards to download concurrently for EC reading | No, default is 1. The larger the number, the higher the fault tolerance, but also the higher the bandwidth. |
|
||||
@ -178,6 +179,9 @@ Support for `health_port` began with version v3.2.1.
|
||||
"12": true,
|
||||
"15": true
|
||||
},
|
||||
"code_mode_get_ignore_idc": {
|
||||
"14": true
|
||||
},
|
||||
"alloc_retry_times": 3,
|
||||
"alloc_retry_interval_ms": 100,
|
||||
"encoder_concurrency": 1000,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user