Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
f31d4fb1
M
milvus
项目概览
milvus
/
milvus
9 个月 前同步成功
通知
260
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
f31d4fb1
编写于
8月 09, 2023
作者:
Y
yihao.dai
提交者:
GitHub
8月 09, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Disable deny writing when the growing segment size exceeds the watermark (#26163) (#26208)
Signed-off-by:
N
bigsheeper
<
yihao.dai@zilliz.com
>
上级
76ed3070
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
28 addition
and
19 deletion
+28
-19
configs/milvus.yaml
configs/milvus.yaml
+4
-3
internal/rootcoord/quota_center.go
internal/rootcoord/quota_center.go
+7
-12
internal/rootcoord/quota_center_test.go
internal/rootcoord/quota_center_test.go
+5
-4
internal/util/paramtable/quota_param.go
internal/util/paramtable/quota_param.go
+11
-0
internal/util/paramtable/quota_param_test.go
internal/util/paramtable/quota_param_test.go
+1
-0
未找到文件。
configs/milvus.yaml
浏览文件 @
f31d4fb1
...
@@ -576,10 +576,11 @@ quotaAndLimits:
...
@@ -576,10 +576,11 @@ quotaAndLimits:
queryNodeMemoryLowWaterLevel
:
0.85
# (0, 1], memoryLowWaterLevel in QueryNodes
queryNodeMemoryLowWaterLevel
:
0.85
# (0, 1], memoryLowWaterLevel in QueryNodes
queryNodeMemoryHighWaterLevel
:
0.95
# (0, 1], memoryHighWaterLevel in QueryNodes
queryNodeMemoryHighWaterLevel
:
0.95
# (0, 1], memoryHighWaterLevel in QueryNodes
growingSegmentsSizeProtection
:
growingSegmentsSizeProtection
:
#
1. No action will be taken if the ratio of growing segments size is less than the low water level
.
#
No action will be taken if the growing segments size is less than the low watermark
.
#
2. The DML rate will be reduced if the ratio of growing segments size is greater than the low water level and less than the high water level.
#
When the growing segments size exceeds the low watermark, the dml rate will be reduced,
#
3. All DML requests will be rejected if the ratio of growing segments size is greater than the high water level
.
#
but the rate will not be lower than `minRateRatio * dmlRate`
.
enabled
:
false
enabled
:
false
minRateRatio
:
0.5
lowWaterLevel
:
0.2
lowWaterLevel
:
0.2
highWaterLevel
:
0.4
highWaterLevel
:
0.4
diskProtection
:
diskProtection
:
...
...
internal/rootcoord/quota_center.go
浏览文件 @
f31d4fb1
...
@@ -640,24 +640,19 @@ func (q *QuotaCenter) getGrowingSegmentsSizeFactor() map[int64]float64 {
...
@@ -640,24 +640,19 @@ func (q *QuotaCenter) getGrowingSegmentsSizeFactor() map[int64]float64 {
if
cur
<=
low
{
if
cur
<=
low
{
continue
continue
}
}
if
cur
>=
high
{
log
.
RatedWarn
(
10
,
"QuotaCenter: QueryNode growing segments size to high water level"
,
zap
.
String
(
"Node"
,
fmt
.
Sprintf
(
"%s-%d"
,
typeutil
.
QueryNodeRole
,
nodeID
)),
zap
.
Int64s
(
"collections"
,
metric
.
Effect
.
CollectionIDs
),
zap
.
Int64
(
"segmentsSize"
,
metric
.
GrowingSegmentsSize
),
zap
.
Uint64
(
"TotalMem"
,
metric
.
Hms
.
Memory
),
zap
.
Float64
(
"highWaterLevel"
,
high
))
updateCollectionFactor
(
0
,
metric
.
Effect
.
CollectionIDs
)
continue
}
factor
:=
(
high
-
cur
)
/
(
high
-
low
)
factor
:=
(
high
-
cur
)
/
(
high
-
low
)
if
factor
<
Params
.
QuotaConfig
.
GrowingSegmentsSizeMinRateRatio
{
factor
=
Params
.
QuotaConfig
.
GrowingSegmentsSizeMinRateRatio
}
updateCollectionFactor
(
factor
,
metric
.
Effect
.
CollectionIDs
)
updateCollectionFactor
(
factor
,
metric
.
Effect
.
CollectionIDs
)
log
.
RatedWarn
(
10
,
"QuotaCenter: QueryNode growing segments size
to low water level
, limit writing rate"
,
log
.
RatedWarn
(
10
,
"QuotaCenter: QueryNode growing segments size
exceeds watermark
, limit writing rate"
,
zap
.
String
(
"Node"
,
fmt
.
Sprintf
(
"%s-%d"
,
typeutil
.
QueryNodeRole
,
nodeID
)),
zap
.
String
(
"Node"
,
fmt
.
Sprintf
(
"%s-%d"
,
typeutil
.
QueryNodeRole
,
nodeID
)),
zap
.
Int64s
(
"collections"
,
metric
.
Effect
.
CollectionIDs
),
zap
.
Int64s
(
"collections"
,
metric
.
Effect
.
CollectionIDs
),
zap
.
Int64
(
"segmentsSize"
,
metric
.
GrowingSegmentsSize
),
zap
.
Int64
(
"segmentsSize"
,
metric
.
GrowingSegmentsSize
),
zap
.
Uint64
(
"TotalMem"
,
metric
.
Hms
.
Memory
),
zap
.
Uint64
(
"TotalMem"
,
metric
.
Hms
.
Memory
),
zap
.
Float64
(
"lowWaterLevel"
,
low
))
zap
.
Float64
(
"highWatermark"
,
high
),
zap
.
Float64
(
"lowWatermark"
,
low
),
zap
.
Float64
(
"factor"
,
factor
))
}
}
return
collectionFactor
return
collectionFactor
}
}
...
...
internal/rootcoord/quota_center_test.go
浏览文件 @
f31d4fb1
...
@@ -410,6 +410,7 @@ func TestQuotaCenter(t *testing.T) {
...
@@ -410,6 +410,7 @@ func TestQuotaCenter(t *testing.T) {
t
.
Run
(
"test GrowingSegmentsSize factors"
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"test GrowingSegmentsSize factors"
,
func
(
t
*
testing
.
T
)
{
qc
:=
types
.
NewMockQueryCoord
(
t
)
qc
:=
types
.
NewMockQueryCoord
(
t
)
quotaCenter
:=
NewQuotaCenter
(
pcm
,
qc
,
&
dataCoordMockForQuota
{},
core
.
tsoAllocator
)
quotaCenter
:=
NewQuotaCenter
(
pcm
,
qc
,
&
dataCoordMockForQuota
{},
core
.
tsoAllocator
)
defaultRatio
:=
Params
.
QuotaConfig
.
GrowingSegmentsSizeMinRateRatio
tests
:=
[]
struct
{
tests
:=
[]
struct
{
low
float64
low
float64
high
float64
high
float64
...
@@ -421,15 +422,15 @@ func TestQuotaCenter(t *testing.T) {
...
@@ -421,15 +422,15 @@ func TestQuotaCenter(t *testing.T) {
{
0.8
,
0.9
,
80
,
100
,
1
},
{
0.8
,
0.9
,
80
,
100
,
1
},
{
0.8
,
0.9
,
82
,
100
,
0.8
},
{
0.8
,
0.9
,
82
,
100
,
0.8
},
{
0.8
,
0.9
,
85
,
100
,
0.5
},
{
0.8
,
0.9
,
85
,
100
,
0.5
},
{
0.8
,
0.9
,
88
,
100
,
0.2
},
{
0.8
,
0.9
,
88
,
100
,
defaultRatio
},
{
0.8
,
0.9
,
90
,
100
,
0
},
{
0.8
,
0.9
,
90
,
100
,
defaultRatio
},
{
0.85
,
0.95
,
25
,
100
,
1
},
{
0.85
,
0.95
,
25
,
100
,
1
},
{
0.85
,
0.95
,
85
,
100
,
1
},
{
0.85
,
0.95
,
85
,
100
,
1
},
{
0.85
,
0.95
,
87
,
100
,
0.8
},
{
0.85
,
0.95
,
87
,
100
,
0.8
},
{
0.85
,
0.95
,
90
,
100
,
0.5
},
{
0.85
,
0.95
,
90
,
100
,
0.5
},
{
0.85
,
0.95
,
93
,
100
,
0.2
},
{
0.85
,
0.95
,
93
,
100
,
defaultRatio
},
{
0.85
,
0.95
,
95
,
100
,
0
},
{
0.85
,
0.95
,
95
,
100
,
defaultRatio
},
}
}
quotaCenter
.
writableCollections
=
append
(
quotaCenter
.
writableCollections
,
1
,
2
,
3
)
quotaCenter
.
writableCollections
=
append
(
quotaCenter
.
writableCollections
,
1
,
2
,
3
)
...
...
internal/util/paramtable/quota_param.go
浏览文件 @
f31d4fb1
...
@@ -111,6 +111,7 @@ type quotaConfig struct {
...
@@ -111,6 +111,7 @@ type quotaConfig struct {
QueryNodeMemoryLowWaterLevel
float64
QueryNodeMemoryLowWaterLevel
float64
QueryNodeMemoryHighWaterLevel
float64
QueryNodeMemoryHighWaterLevel
float64
GrowingSegmentsSizeProtectionEnabled
bool
GrowingSegmentsSizeProtectionEnabled
bool
GrowingSegmentsSizeMinRateRatio
float64
GrowingSegmentsSizeLowWaterLevel
float64
GrowingSegmentsSizeLowWaterLevel
float64
GrowingSegmentsSizeHighWaterLevel
float64
GrowingSegmentsSizeHighWaterLevel
float64
DiskProtectionEnabled
bool
DiskProtectionEnabled
bool
...
@@ -188,6 +189,7 @@ func (p *quotaConfig) init(base *BaseTable) {
...
@@ -188,6 +189,7 @@ func (p *quotaConfig) init(base *BaseTable) {
p
.
initQueryNodeMemoryLowWaterLevel
()
p
.
initQueryNodeMemoryLowWaterLevel
()
p
.
initQueryNodeMemoryHighWaterLevel
()
p
.
initQueryNodeMemoryHighWaterLevel
()
p
.
initGrowingSegmentsSizeProtectionEnabled
()
p
.
initGrowingSegmentsSizeProtectionEnabled
()
p
.
initGrowingSegmentsSizeMinRateRatio
()
p
.
initGrowingSegmentsSizeLowWaterLevel
()
p
.
initGrowingSegmentsSizeLowWaterLevel
()
p
.
initGrowingSegmentsSizeHighWaterLevel
()
p
.
initGrowingSegmentsSizeHighWaterLevel
()
p
.
initDiskProtectionEnabled
()
p
.
initDiskProtectionEnabled
()
...
@@ -726,6 +728,15 @@ func (p *quotaConfig) initGrowingSegmentsSizeProtectionEnabled() {
...
@@ -726,6 +728,15 @@ func (p *quotaConfig) initGrowingSegmentsSizeProtectionEnabled() {
p
.
GrowingSegmentsSizeProtectionEnabled
=
p
.
Base
.
ParseBool
(
"quotaAndLimits.limitWriting.growingSegmentsSizeProtection.enabled"
,
false
)
p
.
GrowingSegmentsSizeProtectionEnabled
=
p
.
Base
.
ParseBool
(
"quotaAndLimits.limitWriting.growingSegmentsSizeProtection.enabled"
,
false
)
}
}
func
(
p
*
quotaConfig
)
initGrowingSegmentsSizeMinRateRatio
()
{
defaultGrowingSegmentsSizeMinRateRatio
:=
0.5
p
.
GrowingSegmentsSizeMinRateRatio
=
p
.
Base
.
ParseFloatWithDefault
(
"quotaAndLimits.limitWriting.growingSegmentsSizeProtection.minRateRatio"
,
defaultGrowingSegmentsSizeMinRateRatio
)
if
p
.
GrowingSegmentsSizeMinRateRatio
<=
0
||
p
.
GrowingSegmentsSizeMinRateRatio
>
1
{
log
.
Warn
(
"GrowingSegmentsSizeMinRateRatio must in the range of `(0, 1]`, use default value"
,
zap
.
Float64
(
"default"
,
defaultGrowingSegmentsSizeMinRateRatio
))
p
.
GrowingSegmentsSizeMinRateRatio
=
defaultGrowingSegmentsSizeMinRateRatio
}
}
func
(
p
*
quotaConfig
)
initGrowingSegmentsSizeLowWaterLevel
()
{
func
(
p
*
quotaConfig
)
initGrowingSegmentsSizeLowWaterLevel
()
{
defaultGrowingSegSizeLowWaterLevel
:=
0.2
defaultGrowingSegSizeLowWaterLevel
:=
0.2
p
.
GrowingSegmentsSizeLowWaterLevel
=
p
.
Base
.
ParseFloatWithDefault
(
"quotaAndLimits.limitWriting.growingSegmentsSizeProtection.lowWaterLevel"
,
defaultGrowingSegSizeLowWaterLevel
)
p
.
GrowingSegmentsSizeLowWaterLevel
=
p
.
Base
.
ParseFloatWithDefault
(
"quotaAndLimits.limitWriting.growingSegmentsSizeProtection.lowWaterLevel"
,
defaultGrowingSegSizeLowWaterLevel
)
...
...
internal/util/paramtable/quota_param_test.go
浏览文件 @
f31d4fb1
...
@@ -173,6 +173,7 @@ func TestQuotaParam(t *testing.T) {
...
@@ -173,6 +173,7 @@ func TestQuotaParam(t *testing.T) {
assert
.
Equal
(
t
,
defaultLowWaterLevel
,
qc
.
QueryNodeMemoryLowWaterLevel
)
assert
.
Equal
(
t
,
defaultLowWaterLevel
,
qc
.
QueryNodeMemoryLowWaterLevel
)
assert
.
Equal
(
t
,
defaultHighWaterLevel
,
qc
.
QueryNodeMemoryHighWaterLevel
)
assert
.
Equal
(
t
,
defaultHighWaterLevel
,
qc
.
QueryNodeMemoryHighWaterLevel
)
assert
.
Equal
(
t
,
false
,
qc
.
GrowingSegmentsSizeProtectionEnabled
)
assert
.
Equal
(
t
,
false
,
qc
.
GrowingSegmentsSizeProtectionEnabled
)
assert
.
Equal
(
t
,
0.5
,
qc
.
GrowingSegmentsSizeMinRateRatio
)
assert
.
Equal
(
t
,
0.2
,
qc
.
GrowingSegmentsSizeLowWaterLevel
)
assert
.
Equal
(
t
,
0.2
,
qc
.
GrowingSegmentsSizeLowWaterLevel
)
assert
.
Equal
(
t
,
0.4
,
qc
.
GrowingSegmentsSizeHighWaterLevel
)
assert
.
Equal
(
t
,
0.4
,
qc
.
GrowingSegmentsSizeHighWaterLevel
)
assert
.
Equal
(
t
,
true
,
qc
.
DiskProtectionEnabled
)
assert
.
Equal
(
t
,
true
,
qc
.
DiskProtectionEnabled
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录