Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,14 @@ private boolean containerMoveSatisfiesPlacementPolicy(
replicaList.add(target);
ContainerPlacementStatus placementStatus = placementPolicyValidateProxy
.validateContainerPlacement(replicaList, containerInfo);
return placementStatus.isPolicySatisfied();

boolean isPolicySatisfied = placementStatus.isPolicySatisfied();
if (!isPolicySatisfied) {
logger.debug("Moving container {} from source {} to target {} will not " +
"satisfy placement policy.", containerID, source.getUuidString(),
target.getUuidString());
}
return isPolicySatisfied;
}

/**
Expand All @@ -185,10 +192,26 @@ private boolean canSizeEnterTarget(DatanodeDetails target, long size) {
// MaxSizeEnteringTarget
//2 current usage of target datanode plus sizeEnteringAfterMove
// is smaller than or equal to upperLimit
return sizeEnteringAfterMove <= config.getMaxSizeEnteringTarget() &&
Double.compare(nodeManager.getUsageInfo(target)
.calculateUtilization(sizeEnteringAfterMove), upperLimit) <= 0;
if (sizeEnteringAfterMove > config.getMaxSizeEnteringTarget()) {
logger.debug("{} bytes cannot enter datanode {} because 'size" +
".entering.target.max' limit is {} and {} bytes have already " +
"entered.", size, target.getUuidString(),
config.getMaxSizeEnteringTarget(),
sizeEnteringNode.get(target));
return false;
}
if (Double.compare(nodeManager.getUsageInfo(target)
.calculateUtilization(sizeEnteringAfterMove), upperLimit) > 0) {
logger.debug("{} bytes cannot enter datanode {} because its " +
"utilization will exceed the upper limit of {}.", size,
target.getUuidString(), upperLimit);
return false;
}
return true;
}

logger.warn("No record of how much size has entered datanode {}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this warn worth? or should should it be a debug or info?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong opinion on this. When searching logs, if this warning shows up then I know something is wrong. It can be info too, but debug won't be much help.

target.getUuidString());
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,24 @@ public boolean canSizeLeaveSource(DatanodeDetails source, long size) {
// MaxSizeLeavingTarget
//2 after subtracting sizeLeavingAfterMove, the usage is bigger
// than or equal to lowerLimit
return sizeLeavingAfterMove <= config.getMaxSizeLeavingSource() &&
Double.compare(nodeManager.getUsageInfo(source)
.calculateUtilization(-sizeLeavingAfterMove), lowerLimit) >= 0;
if (sizeLeavingAfterMove > config.getMaxSizeLeavingSource()) {
LOG.debug("{} bytes cannot leave datanode {} because 'size.leaving" +
".source.max' limit is {} and {} bytes have already left.",
size, source.getUuidString(), config.getMaxSizeLeavingSource(),
sizeLeavingNode.get(source));
return false;
}
if (Double.compare(nodeManager.getUsageInfo(source)
.calculateUtilization(-sizeLeavingAfterMove), lowerLimit) < 0) {
LOG.debug("{} bytes cannot leave datanode {} because its utilization " +
"will drop below the lower limit of {}.", size,
source.getUuidString(), lowerLimit);
return false;
}
return true;
}

LOG.warn("No record of how much size has left datanode {}", source);
return false;
}

Expand Down