mirror of
https://github.com/apache/druid.git
synced 2025-02-09 11:34:54 +00:00
Fix bug in computed value of balancerComputeThreads (#14947)
In smartSegmentLoading mode, use computed value of balancerComputeThreads rather than configured value.
This commit is contained in:
parent
a8fa979115
commit
88f3c9baed
@ -94,7 +94,7 @@ public class PrepareBalancerAndLoadQueues implements CoordinatorDuty
|
|||||||
collectHistoricalStats(cluster, stats);
|
collectHistoricalStats(cluster, stats);
|
||||||
collectUsedSegmentStats(params, stats);
|
collectUsedSegmentStats(params, stats);
|
||||||
|
|
||||||
int numBalancerThreads = params.getCoordinatorDynamicConfig().getBalancerComputeThreads();
|
final int numBalancerThreads = segmentLoadingConfig.getBalancerComputeThreads();
|
||||||
final BalancerStrategy balancerStrategy = balancerStrategyFactory.createBalancerStrategy(numBalancerThreads);
|
final BalancerStrategy balancerStrategy = balancerStrategyFactory.createBalancerStrategy(numBalancerThreads);
|
||||||
log.info(
|
log.info(
|
||||||
"Using balancer strategy [%s] with [%d] threads.",
|
"Using balancer strategy [%s] with [%d] threads.",
|
||||||
|
@ -49,9 +49,11 @@ public class SegmentLoadingConfig
|
|||||||
// Compute replicationThrottleLimit with a lower bound of 100
|
// Compute replicationThrottleLimit with a lower bound of 100
|
||||||
final int throttlePercentage = 5;
|
final int throttlePercentage = 5;
|
||||||
final int replicationThrottleLimit = Math.max(100, numUsedSegments * throttlePercentage / 100);
|
final int replicationThrottleLimit = Math.max(100, numUsedSegments * throttlePercentage / 100);
|
||||||
|
final int numBalancerThreads = CoordinatorDynamicConfig.getDefaultBalancerComputeThreads();
|
||||||
log.info(
|
log.info(
|
||||||
"Smart segment loading is enabled. Calculated replicationThrottleLimit[%,d] (%d%% of used segments[%,d]).",
|
"Smart segment loading is enabled. Calculated replicationThrottleLimit[%,d]"
|
||||||
replicationThrottleLimit, throttlePercentage, numUsedSegments
|
+ " (%d%% of used segments[%,d]) and numBalancerThreads[%d].",
|
||||||
|
replicationThrottleLimit, throttlePercentage, numUsedSegments, numBalancerThreads
|
||||||
);
|
);
|
||||||
|
|
||||||
return new SegmentLoadingConfig(
|
return new SegmentLoadingConfig(
|
||||||
@ -59,7 +61,7 @@ public class SegmentLoadingConfig
|
|||||||
replicationThrottleLimit,
|
replicationThrottleLimit,
|
||||||
60,
|
60,
|
||||||
true,
|
true,
|
||||||
CoordinatorDynamicConfig.getDefaultBalancerComputeThreads()
|
numBalancerThreads
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Use the configured values
|
// Use the configured values
|
||||||
|
Loading…
x
Reference in New Issue
Block a user