From 4f724f1c830c2bcf52e094660aa77ce046abebca Mon Sep 17 00:00:00 2001 From: Xiaofan <83447078+xiaofan-luan@users.noreply.github.com> Date: Tue, 28 Mar 2023 20:06:08 +0800 Subject: [PATCH] Add config for disable BF load (#22998) Signed-off-by: xiaofan-luan --- internal/querynode/segment.go | 6 ++++++ internal/querynode/segment_loader.go | 5 +++++ internal/util/paramtable/component_param.go | 8 ++++++++ 3 files changed, 19 insertions(+) diff --git a/internal/querynode/segment.go b/internal/querynode/segment.go index 0864ffcef2..52af55ad2e 100644 --- a/internal/querynode/segment.go +++ b/internal/querynode/segment.go @@ -613,6 +613,12 @@ func (s *Segment) InitCurrentStat() { func (s *Segment) isPKExist(pk primaryKey) bool { s.statLock.Lock() defer s.statLock.Unlock() + + if Params.DataNodeCfg.SkipBFStatsLoad { + log.Warn("processing delete while skip load BF, may affect performance", zap.Any("pk", pk), zap.Int64("segmentID", s.segmentID)) + return true + } + if s.currentStat != nil && s.currentStat.PkExist(pk) { return true } diff --git a/internal/querynode/segment_loader.go b/internal/querynode/segment_loader.go index 841ce54c87..16cb3de1c1 100644 --- a/internal/querynode/segment_loader.go +++ b/internal/querynode/segment_loader.go @@ -641,6 +641,11 @@ func (loader *segmentLoader) loadSegmentBloomFilter(ctx context.Context, segment return nil } + if Params.DataNodeCfg.SkipBFStatsLoad { + log.Info("skip load BF with config set ", zap.Int64("segmentID", segment.segmentID)) + return nil + } + startTs := time.Now() values, err := loader.cm.MultiRead(ctx, binlogPaths) if err != nil { diff --git a/internal/util/paramtable/component_param.go b/internal/util/paramtable/component_param.go index d527c41501..7bf8fd59bb 100644 --- a/internal/util/paramtable/component_param.go +++ b/internal/util/paramtable/component_param.go @@ -1574,6 +1574,8 @@ type dataNodeConfig struct { MemoryForceSyncEnable bool MemoryForceSyncSegmentNum int MemoryWatermark float64 + + SkipBFStatsLoad bool } func (p *dataNodeConfig) init(base *BaseTable) { @@ -1589,6 +1591,8 @@ func (p *dataNodeConfig) init(base *BaseTable) { p.initIOConcurrency() p.initDataNodeTimeTickInterval() + p.initSkipBFStatsLoad() + p.initChannelWatchPath() p.initMemoryForceSyncEnable() p.initMemoryWatermark() @@ -1653,6 +1657,10 @@ func (p *dataNodeConfig) initDataNodeTimeTickInterval() { p.DataNodeTimeTickInterval = p.Base.ParseIntWithDefault("datanode.timetick.interval", 500) } +func (p *dataNodeConfig) initSkipBFStatsLoad() { + p.SkipBFStatsLoad = p.Base.ParseBool("dataNode.skip.BFStats.Load", false) +} + func (p *dataNodeConfig) SetNodeID(id UniqueID) { p.NodeID.Store(id) }