mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-10 15:14:09 +00:00
lib/storage: remove ForceMergeAllParts internal loop (#4999)
Signed-off-by: faceair <git@faceair.me>
This commit is contained in:
parent
ba7892d1de
commit
2d3f09b6d9
1 changed files with 17 additions and 21 deletions
|
@ -945,7 +945,7 @@ func (pt *partition) ForceMergeAllParts() error {
|
|||
// Nothing to merge.
|
||||
return nil
|
||||
}
|
||||
for {
|
||||
|
||||
// Check whether there is enough disk space for merging pws.
|
||||
newPartSize := getPartsSize(pws)
|
||||
maxOutBytes := fs.MustGetFreeSpace(pt.bigPartsPath)
|
||||
|
@ -962,13 +962,9 @@ func (pt *partition) ForceMergeAllParts() error {
|
|||
if err := pt.mergePartsOptimal(pws, pt.stopCh); err != nil {
|
||||
return fmt.Errorf("cannot force merge %d parts from partition %q: %w", len(pws), pt.name, err)
|
||||
}
|
||||
pws = pt.getAllPartsForMerge()
|
||||
if len(pws) <= 1 {
|
||||
pt.releasePartsToMerge(pws)
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var forceMergeLogger = logger.WithThrottler("forceMerge", time.Minute)
|
||||
|
||||
|
|
Loading…
Reference in a new issue