Add config for disable BF load (#22996)

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

View File

@ -614,6 +614,12 @@ func (s *Segment) InitCurrentStat() {
func (s *Segment) isPKExist(pk primaryKey) bool {
s.statLock.Lock()
defer s.statLock.Unlock()
if Params.DataNodeCfg.SkipBFStatsLoad.GetAsBool() {
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

@ -642,6 +642,11 @@ func (loader *segmentLoader) loadSegmentBloomFilter(ctx context.Context, segment
return nil
}
if Params.DataNodeCfg.SkipBFStatsLoad.GetAsBool() {
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

@ -2036,6 +2036,9 @@ type dataNodeConfig struct {
// DataNode send timetick interval per collection
DataNodeTimeTickInterval ParamItem `refreshable:"false"`
// Skip BF
SkipBFStatsLoad ParamItem `refreshable:"true"`
}
func (p *dataNodeConfig) init(base *BaseTable) {
@ -2150,6 +2153,14 @@ func (p *dataNodeConfig) init(base *BaseTable) {
DefaultValue: "500",
}
p.DataNodeTimeTickInterval.Init(base.mgr)
p.SkipBFStatsLoad = ParamItem{
Key: "dataNode.skip.BFStats.Load",
Version: "2.2.5",
PanicIfEmpty: false,
DefaultValue: "false",
}
p.SkipBFStatsLoad.Init(base.mgr)
}
// /////////////////////////////////////////////////////////////////////////////