Skip to content
Merged
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 @@ -746,8 +746,9 @@ private void handleOverReplicatedContainer(final ContainerInfo container,
if (excess > 0) {
sendDeleteCommand(container, r.getDatanodeDetails(), true);
excess -= 1;
} else {
break;
}
break;
Copy link
Contributor

@linyiqun linyiqun Oct 14, 2020

Choose a reason for hiding this comment

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

Looking into this PR change, I am thinking if we still need to do excess check before sending delete command for unhealthy containers. As we want to remove all unhealthy container replicas, we can just send delete command and decrease the excess count by the way.

I prefer simplified the logic like below:

      for (ContainerReplica r : unhealthyReplicas) {
          sendDeleteCommand(container, r.getDatanodeDetails(), true);
          excess -= 1;
      }

The unhealthyReplicas will also removed in ReplicationManager#handleUnstableContainer if we don't remove all them here.

Copy link
Contributor

Choose a reason for hiding this comment

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

@linyiqun What if there is an excess of containers, but all containers are somehow unhealthy? We don't want RM to remove all copies of them, as that could result in a lost container. That is why we limit the number of unhealthy containers removed to the excess number.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, get it. Thanks @sodonnel.

}
// After removing all unhealthy replicas, if the container is still over
// replicated then we need to check if it is already mis-replicated.
Expand Down