mirror of https://github.com/apache/druid.git
better logic for exiting load rule assign if replicants cannot be created
This commit is contained in:
parent
f422bfae8c
commit
4e84fb5f03
|
@ -92,6 +92,12 @@ public abstract class LoadRule implements Rule
|
||||||
final MasterStats stats = new MasterStats();
|
final MasterStats stats = new MasterStats();
|
||||||
|
|
||||||
while (totalReplicants < expectedReplicants) {
|
while (totalReplicants < expectedReplicants) {
|
||||||
|
boolean replicate = totalReplicants > 0;
|
||||||
|
|
||||||
|
if (replicate && !replicationManager.canAddReplicant(getTier())) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
final ServerHolder holder = analyzer.findNewSegmentHomeAssign(segment, serverHolderList);
|
final ServerHolder holder = analyzer.findNewSegmentHomeAssign(segment, serverHolderList);
|
||||||
|
|
||||||
if (holder == null) {
|
if (holder == null) {
|
||||||
|
@ -104,15 +110,10 @@ public abstract class LoadRule implements Rule
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (totalReplicants > 0) { // don't throttle if there's only 1 copy of this segment in the cluster
|
if (replicate && !replicationManager.registerReplicantCreation(
|
||||||
if (!replicationManager.canAddReplicant(getTier()) ||
|
getTier(), segment.getIdentifier(), holder.getServer().getHost()
|
||||||
!replicationManager.registerReplicantCreation(
|
)) {
|
||||||
getTier(),
|
break;
|
||||||
segment.getIdentifier(),
|
|
||||||
holder.getServer().getHost()
|
|
||||||
)) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
holder.getPeon().loadSegment(
|
holder.getPeon().loadSegment(
|
||||||
|
|
Loading…
Reference in New Issue