mirror of https://github.com/apache/druid.git
fix exception catching logic of moving segments
This commit is contained in:
parent
8b480e55db
commit
9b4c3756ed
|
@ -156,12 +156,11 @@ public class DruidMasterBalancer implements DruidMasterHelper
|
||||||
(toServer.getSegment(segmentName) == null) &&
|
(toServer.getSegment(segmentName) == null) &&
|
||||||
new ServerHolder(toServer, toPeon).getAvailableSize() > segmentToMove.getSize()) {
|
new ServerHolder(toServer, toPeon).getAvailableSize() > segmentToMove.getSize()) {
|
||||||
log.info("Moving [%s] from [%s] to [%s]", segmentName, fromServerName, toServerName);
|
log.info("Moving [%s] from [%s] to [%s]", segmentName, fromServerName, toServerName);
|
||||||
|
|
||||||
|
LoadPeonCallback callback = null;
|
||||||
try {
|
try {
|
||||||
master.moveSegment(
|
currentlyMovingSegments.get(toServer.getTier()).put(segmentName, segment);
|
||||||
fromServerName,
|
callback = new LoadPeonCallback()
|
||||||
toServerName,
|
|
||||||
segmentToMove.getIdentifier(),
|
|
||||||
new LoadPeonCallback()
|
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
protected void execute()
|
protected void execute()
|
||||||
|
@ -171,12 +170,19 @@ public class DruidMasterBalancer implements DruidMasterHelper
|
||||||
movingSegments.remove(segmentName);
|
movingSegments.remove(segmentName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
master.moveSegment(
|
||||||
|
fromServerName,
|
||||||
|
toServerName,
|
||||||
|
segmentToMove.getIdentifier(),
|
||||||
|
callback
|
||||||
);
|
);
|
||||||
currentlyMovingSegments.get(toServer.getTier()).put(segmentName, segment);
|
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
log.makeAlert(e, String.format("[%s] : Moving exception", segmentName)).emit();
|
log.makeAlert(e, String.format("[%s] : Moving exception", segmentName)).emit();
|
||||||
|
if (callback != null) {
|
||||||
|
callback.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
currentlyMovingSegments.get(toServer.getTier()).remove(segmentName);
|
currentlyMovingSegments.get(toServer.getTier()).remove(segmentName);
|
||||||
|
|
Loading…
Reference in New Issue