Add config for disable BF load (#22995)

Signed-off-by: xiaofan-luan <xiaofan.luan@zilliz.com>
This commit is contained in:
Xiaofan 2023-03-27 09:41:18 +08:00 committed by GitHub
parent 0ceb264d35
commit dd38eb5fb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 0 deletions

View File

@ -611,6 +611,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
}

View File

@ -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 {

View File

@ -1533,6 +1533,9 @@ type dataNodeConfig struct {
CreatedTime time.Time
UpdatedTime time.Time
// skip BF load on datanode recovery
SkipBFStatsLoad bool
}
func (p *dataNodeConfig) init(base *BaseTable) {
@ -1546,6 +1549,8 @@ func (p *dataNodeConfig) init(base *BaseTable) {
p.initSyncPeriod()
p.initIOConcurrency()
p.initSkipBFStatsLoad()
p.initChannelWatchPath()
}
@ -1599,6 +1604,10 @@ func (p *dataNodeConfig) initIOConcurrency() {
p.IOConcurrency = p.Base.ParseIntWithDefault("dataNode.dataSync.ioConcurrency", 10)
}
func (p *dataNodeConfig) initSkipBFStatsLoad() {
p.SkipBFStatsLoad = p.Base.ParseBool("dataNode.skip.BFStats.Load", false)
}
func (p *dataNodeConfig) SetNodeID(id UniqueID) {
p.NodeID.Store(id)
}