enhance: [10kcp] Optimize GetLocalDiskSize and segment loader mutex (#38601)

fix of pr: https://github.com/milvus-io/milvus/pull/38599

---------

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
pull/38683/head
yihao.dai 2024-12-19 21:29:13 +08:00 committed by GitHub
parent ecd55596cf
commit bf27f70c32
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 10 deletions

View File

@ -65,14 +65,12 @@ func (d *diskUsageFetcher) Start() {
interval := paramtable.Get().QueryNodeCfg.DiskSizeFetchInterval.GetAsDuration(time.Second)
ticker := time.NewTicker(interval)
defer ticker.Stop()
go func() {
for {
select {
case <-d.ctx.Done():
return
case <-ticker.C:
d.fetch()
}
for {
select {
case <-d.ctx.Done():
return
case <-ticker.C:
d.fetch()
}
}()
}
}

View File

@ -567,7 +567,7 @@ func NewLoader(
log.Info("SegmentLoader created", zap.Int("ioPoolSize", ioPoolSize))
duf := NewDiskUsageFetcher(ctx)
duf.Start()
go duf.Start()
loader := &segmentLoader{
manager: manager,