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();
|
||||
|
||||
while (totalReplicants < expectedReplicants) {
|
||||
boolean replicate = totalReplicants > 0;
|
||||
|
||||
if (replicate && !replicationManager.canAddReplicant(getTier())) {
|
||||
break;
|
||||
}
|
||||
|
||||
final ServerHolder holder = analyzer.findNewSegmentHomeAssign(segment, serverHolderList);
|
||||
|
||||
if (holder == null) {
|
||||
|
@ -104,16 +110,11 @@ public abstract class LoadRule implements Rule
|
|||
break;
|
||||
}
|
||||
|
||||
if (totalReplicants > 0) { // don't throttle if there's only 1 copy of this segment in the cluster
|
||||
if (!replicationManager.canAddReplicant(getTier()) ||
|
||||
!replicationManager.registerReplicantCreation(
|
||||
getTier(),
|
||||
segment.getIdentifier(),
|
||||
holder.getServer().getHost()
|
||||
if (replicate && !replicationManager.registerReplicantCreation(
|
||||
getTier(), segment.getIdentifier(), holder.getServer().getHost()
|
||||
)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
holder.getPeon().loadSegment(
|
||||
segment,
|
||||
|
|
Loading…
Reference in New Issue