mirror of https://github.com/apache/druid.git
log correct moved count on balance instead of snapshot of currently moving (#6032)
This commit is contained in:
parent
0754d78a2e
commit
297810e7a4
|
@ -129,9 +129,9 @@ public class DruidCoordinatorBalancer implements DruidCoordinatorHelper
|
||||||
final int maxSegmentsToMove = Math.min(params.getCoordinatorDynamicConfig().getMaxSegmentsToMove(), numSegments);
|
final int maxSegmentsToMove = Math.min(params.getCoordinatorDynamicConfig().getMaxSegmentsToMove(), numSegments);
|
||||||
final int maxIterations = 2 * maxSegmentsToMove;
|
final int maxIterations = 2 * maxSegmentsToMove;
|
||||||
final int maxToLoad = params.getCoordinatorDynamicConfig().getMaxSegmentsInNodeLoadingQueue();
|
final int maxToLoad = params.getCoordinatorDynamicConfig().getMaxSegmentsInNodeLoadingQueue();
|
||||||
long unmoved = 0L;
|
int moved = 0, unmoved = 0;
|
||||||
|
|
||||||
for (int moved = 0, iter = 0; (moved + unmoved) < maxSegmentsToMove; ++iter) {
|
for (int iter = 0; (moved + unmoved) < maxSegmentsToMove; ++iter) {
|
||||||
final BalancerSegmentHolder segmentToMoveHolder = strategy.pickSegmentToMove(toMoveFrom);
|
final BalancerSegmentHolder segmentToMoveHolder = strategy.pickSegmentToMove(toMoveFrom);
|
||||||
|
|
||||||
if (segmentToMoveHolder != null && params.getAvailableSegments().contains(segmentToMoveHolder.getSegment())) {
|
if (segmentToMoveHolder != null && params.getAvailableSegments().contains(segmentToMoveHolder.getSegment())) {
|
||||||
|
@ -179,14 +179,14 @@ public class DruidCoordinatorBalancer implements DruidCoordinatorHelper
|
||||||
log.info("No good moves found in tier [%s]", tier);
|
log.info("No good moves found in tier [%s]", tier);
|
||||||
}
|
}
|
||||||
stats.addToTieredStat("unmovedCount", tier, unmoved);
|
stats.addToTieredStat("unmovedCount", tier, unmoved);
|
||||||
stats.addToTieredStat("movedCount", tier, currentlyMovingSegments.get(tier).size());
|
stats.addToTieredStat("movedCount", tier, moved);
|
||||||
if (params.getCoordinatorDynamicConfig().emitBalancingStats()) {
|
if (params.getCoordinatorDynamicConfig().emitBalancingStats()) {
|
||||||
strategy.emitStats(tier, stats, toMoveFrom);
|
strategy.emitStats(tier, stats, toMoveFrom);
|
||||||
}
|
}
|
||||||
log.info(
|
log.info(
|
||||||
"[%s]: Segments Moved: [%d] Segments Let Alone: [%d]",
|
"[%s]: Segments Moved: [%d] Segments Let Alone: [%d]",
|
||||||
tier,
|
tier,
|
||||||
currentlyMovingSegments.get(tier).size(),
|
moved,
|
||||||
unmoved
|
unmoved
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue