Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
63b6a4a6
M
milvus
项目概览
milvus
/
milvus
10 个月 前同步成功
通知
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 搜索 >>
未验证
提交
63b6a4a6
编写于
6月 28, 2023
作者:
X
Xiaofan
提交者:
GitHub
6月 28, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use single instance ppol (#25159)
Signed-off-by:
N
xiaofan-luan
<
xiaofan.luan@zilliz.com
>
上级
e48e9b1c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
26 addition
and
11 deletion
+26
-11
internal/datacoord/channel_manager_test.go
internal/datacoord/channel_manager_test.go
+1
-1
internal/datanode/channel_meta.go
internal/datanode/channel_meta.go
+5
-10
internal/datanode/channel_meta_test.go
internal/datanode/channel_meta_test.go
+7
-0
internal/datanode/io_pool.go
internal/datanode/io_pool.go
+13
-0
未找到文件。
internal/datacoord/channel_manager_test.go
浏览文件 @
63b6a4a6
...
...
@@ -100,7 +100,7 @@ func TestChannelManager_StateTransfer(t *testing.T) {
nodeID
=
UniqueID
(
119
)
channelNamePrefix
=
t
.
Name
()
waitFor
=
time
.
Second
waitFor
=
time
.
Second
*
10
tick
=
time
.
Millisecond
*
10
)
...
...
internal/datanode/channel_meta.go
浏览文件 @
63b6a4a6
...
...
@@ -21,7 +21,6 @@ import (
"fmt"
"math"
"path"
"runtime"
"sync"
"time"
...
...
@@ -122,7 +121,7 @@ type ChannelMeta struct {
metaService
*
metaService
chunkManager
storage
.
ChunkManager
workerPool
*
conc
.
Pool
[
struct
{}
]
workerPool
*
conc
.
Pool
[
any
]
closed
*
atomic
.
Bool
}
...
...
@@ -143,8 +142,6 @@ var _ Channel = &ChannelMeta{}
func
newChannel
(
channelName
string
,
collID
UniqueID
,
schema
*
schemapb
.
CollectionSchema
,
rc
types
.
RootCoord
,
cm
storage
.
ChunkManager
)
*
ChannelMeta
{
metaService
:=
newMetaService
(
rc
,
collID
)
pool
:=
conc
.
NewPool
[
struct
{}](
runtime
.
GOMAXPROCS
(
0
),
conc
.
WithPreAlloc
(
false
),
conc
.
WithNonBlocking
(
false
))
channel
:=
ChannelMeta
{
collectionID
:
collID
,
collSchema
:
schema
,
...
...
@@ -161,7 +158,7 @@ func newChannel(channelName string, collID UniqueID, schema *schemapb.Collection
metaService
:
metaService
,
chunkManager
:
cm
,
workerPool
:
pool
,
workerPool
:
getOrCreateStatsPool
()
,
closed
:
atomic
.
NewBool
(
false
),
}
...
...
@@ -338,7 +335,7 @@ func (c *ChannelMeta) submitLoadStatsTask(s *Segment, statsBinlogs []*datapb.Fie
}
// do submitting in a goroutine in case of task pool is full
go
func
()
{
c
.
workerPool
.
Submit
(
func
()
(
struct
{}
,
error
)
{
c
.
workerPool
.
Submit
(
func
()
(
any
,
error
)
{
stats
,
err
:=
c
.
loadStats
(
context
.
Background
(),
s
.
segmentID
,
s
.
collectionID
,
statsBinlogs
,
ts
)
if
err
!=
nil
{
// TODO if not retryable, add rebuild statslog logic
...
...
@@ -349,7 +346,7 @@ func (c *ChannelMeta) submitLoadStatsTask(s *Segment, statsBinlogs []*datapb.Fie
c
.
submitLoadStatsTask
(
s
,
statsBinlogs
,
ts
)
}
return
struct
{}{}
,
err
return
nil
,
err
}
// get segment lock here
// it's ok that segment is dropped here
...
...
@@ -357,10 +354,8 @@ func (c *ChannelMeta) submitLoadStatsTask(s *Segment, statsBinlogs []*datapb.Fie
defer
c
.
segMu
.
Unlock
()
s
.
historyStats
=
append
(
s
.
historyStats
,
stats
...
)
s
.
setLoadingLazy
(
false
)
log
.
Info
(
"lazy loading segment statslog complete"
)
return
struct
{}{},
nil
return
nil
,
nil
})
}()
}
...
...
internal/datanode/channel_meta_test.go
浏览文件 @
63b6a4a6
...
...
@@ -1197,6 +1197,13 @@ func (s *ChannelMetaMockSuite) TestAddSegment_SkipBFLoad() {
s
.
True
(
seg
.
isLoadingLazy
())
s
.
True
(
seg
.
isPKExist
(
&
storage
.
Int64PrimaryKey
{
Value
:
100
}))
})
}
func
(
s
*
ChannelMetaMockSuite
)
TestAddSegment_SkipBFLoad2
()
{
Params
.
Save
(
Params
.
DataNodeCfg
.
SkipBFStatsLoad
.
Key
,
"true"
)
defer
func
()
{
Params
.
Save
(
Params
.
DataNodeCfg
.
SkipBFStatsLoad
.
Key
,
"false"
)
}()
s
.
Run
(
"transient_error"
,
func
()
{
defer
s
.
SetupTest
()
...
...
internal/datanode/io_pool.go
浏览文件 @
63b6a4a6
package
datanode
import
(
"runtime"
"sync"
"github.com/milvus-io/milvus/pkg/util/conc"
...
...
@@ -9,6 +10,9 @@ import (
var
ioPool
*
conc
.
Pool
[
any
]
var
ioPoolInitOnce
sync
.
Once
var
statsPool
*
conc
.
Pool
[
any
]
var
statsPoolInitOnce
sync
.
Once
func
initIOPool
()
{
capacity
:=
Params
.
DataNodeCfg
.
IOConcurrency
.
GetAsInt
()
if
capacity
>
32
{
...
...
@@ -22,3 +26,12 @@ func getOrCreateIOPool() *conc.Pool[any] {
ioPoolInitOnce
.
Do
(
initIOPool
)
return
ioPool
}
func
initStatsPool
()
{
statsPool
=
conc
.
NewPool
[
any
](
runtime
.
GOMAXPROCS
(
0
),
conc
.
WithPreAlloc
(
false
),
conc
.
WithNonBlocking
(
false
))
}
func
getOrCreateStatsPool
()
*
conc
.
Pool
[
any
]
{
statsPoolInitOnce
.
Do
(
initStatsPool
)
return
statsPool
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录