Skip to content

Commit f893a78

Browse files
authored
Move cleaner bucket index update before clean up partition groups (#6742)
* move cleaner bucket index metrics before cleaning partition group Signed-off-by: yeya24 <[email protected]> * fix metric Signed-off-by: yeya24 <[email protected]> --------- Signed-off-by: yeya24 <[email protected]>
1 parent 7ce1d1b commit f893a78

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pkg/compactor/blocks_cleaner.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -662,18 +662,17 @@ func (c *BlocksCleaner) cleanUser(ctx context.Context, userLogger log.Logger, us
662662
}
663663
level.Info(userLogger).Log("msg", "finish writing new index", "duration", time.Since(begin), "duration_ms", time.Since(begin).Milliseconds())
664664
}
665+
c.tenantBlocks.WithLabelValues(userID).Set(float64(len(idx.Blocks)))
666+
c.tenantBlocksMarkedForDelete.WithLabelValues(userID).Set(float64(len(idx.BlockDeletionMarks)))
667+
c.tenantBlocksMarkedForNoCompaction.WithLabelValues(userID).Set(float64(totalBlocksBlocksMarkedForNoCompaction))
668+
c.tenantPartialBlocks.WithLabelValues(userID).Set(float64(len(partials)))
669+
c.tenantBucketIndexLastUpdate.WithLabelValues(userID).SetToCurrentTime()
665670

666671
if c.cfg.ShardingStrategy == util.ShardingStrategyShuffle && c.cfg.CompactionStrategy == util.CompactionStrategyPartitioning {
667672
begin = time.Now()
668673
c.cleanPartitionedGroupInfo(ctx, userBucket, userLogger, userID)
669674
level.Info(userLogger).Log("msg", "finish cleaning partitioned group info files", "duration", time.Since(begin), "duration_ms", time.Since(begin).Milliseconds())
670675
}
671-
672-
c.tenantBlocks.WithLabelValues(userID).Set(float64(len(idx.Blocks)))
673-
c.tenantBlocksMarkedForDelete.WithLabelValues(userID).Set(float64(len(idx.BlockDeletionMarks)))
674-
c.tenantBlocksMarkedForNoCompaction.WithLabelValues(userID).Set(float64(totalBlocksBlocksMarkedForNoCompaction))
675-
c.tenantBucketIndexLastUpdate.WithLabelValues(userID).SetToCurrentTime()
676-
c.tenantPartialBlocks.WithLabelValues(userID).Set(float64(len(partials)))
677676
return nil
678677
}
679678

0 commit comments

Comments
 (0)