From 6518595f6edd31bf2ece8c3da89c5c795966f5d0 Mon Sep 17 00:00:00 2001 From: slasher Date: Mon, 22 Dec 2025 11:27:41 +0800 Subject: [PATCH] feat(access): no distance for crossing idc getting . #1000573599 Signed-off-by: slasher --- blobstore/access/stream/stream.go | 2 ++ blobstore/access/stream/stream_get.go | 13 ++++++++++--- blobstore/cmd/access/access.conf.default | 3 +++ docs-zh/source/ops/configs/blobstore/access.md | 4 ++++ docs/source/ops/configs/blobstore/access.md | 4 ++++ 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/blobstore/access/stream/stream.go b/blobstore/access/stream/stream.go index fa2be3b91..70abb7f3a 100644 --- a/blobstore/access/stream/stream.go +++ b/blobstore/access/stream/stream.go @@ -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"` diff --git a/blobstore/access/stream/stream_get.go b/blobstore/access/stream/stream_get.go index 2636529d6..d4f327882 100644 --- a/blobstore/access/stream/stream_get.go +++ b/blobstore/access/stream/stream_get.go @@ -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) } diff --git a/blobstore/cmd/access/access.conf.default b/blobstore/cmd/access/access.conf.default index c172ab13f..0c03caa5f 100644 --- a/blobstore/cmd/access/access.conf.default +++ b/blobstore/cmd/access/access.conf.default @@ -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, diff --git a/docs-zh/source/ops/configs/blobstore/access.md b/docs-zh/source/ops/configs/blobstore/access.md index d7d4fcc3f..2a7927793 100755 --- a/docs-zh/source/ops/configs/blobstore/access.md +++ b/docs-zh/source/ops/configs/blobstore/access.md @@ -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, diff --git a/docs/source/ops/configs/blobstore/access.md b/docs/source/ops/configs/blobstore/access.md index 6ea59b6c1..fa2031a6e 100755 --- a/docs/source/ops/configs/blobstore/access.md +++ b/docs/source/ops/configs/blobstore/access.md @@ -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,