Skip to content

Commit

Permalink
lightning: fix an incorrect metric (#52111)
Browse files Browse the repository at this point in the history
close #51947
  • Loading branch information
wjhuang2016 committed Mar 27, 2024
1 parent b96f081 commit e925628
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions br/pkg/lightning/backend/external/engine.go
Expand Up @@ -327,6 +327,7 @@ func (e *Engine) loadBatchRegionData(ctx context.Context, startKey, endKey []byt
e.memKVsAndBuffers.keys = nil
e.memKVsAndBuffers.values = nil
e.memKVsAndBuffers.memKVBuffers = nil
e.memKVsAndBuffers.size = 0

sendFn := func(dr common.DataAndRange) error {
select {
Expand Down
1 change: 1 addition & 0 deletions br/pkg/lightning/backend/external/merge_v2.go
Expand Up @@ -159,6 +159,7 @@ func MergeOverlappingFilesV2(
loaded.keys = nil
loaded.values = nil
loaded.memKVBuffers = nil
loaded.size = 0

if len(endKeyOfGroup) == 0 {
break
Expand Down
2 changes: 1 addition & 1 deletion br/pkg/lightning/backend/external/reader.go
Expand Up @@ -190,7 +190,7 @@ func readOneFile(
output.mu.Lock()
output.keysPerFile = append(output.keysPerFile, keys)
output.valuesPerFile = append(output.valuesPerFile, values)
output.size = size
output.size += size
output.droppedSizePerFile = append(output.droppedSizePerFile, droppedSize)
output.mu.Unlock()
return nil
Expand Down

0 comments on commit e925628

Please sign in to comment.