-
Notifications
You must be signed in to change notification settings - Fork 624
HDDS-12426. SCM replication should check double of container size. #8080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ | |
| import java.util.UUID; | ||
| import java.util.function.Function; | ||
| import java.util.stream.Collectors; | ||
| import org.apache.hadoop.hdds.HddsUtils; | ||
| import org.apache.hadoop.hdds.protocol.DatanodeDetails; | ||
| import org.apache.hadoop.hdds.protocol.proto.HddsProtos; | ||
| import org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.ContainerReplicaProto; | ||
|
|
@@ -78,7 +79,7 @@ public static List<DatanodeDetails> getTargetDatanodes(PlacementPolicy policy, | |
| // Ensure that target datanodes have enough space to hold a complete | ||
| // container. | ||
| final long dataSizeRequired = | ||
| Math.max(container.getUsedBytes(), defaultContainerSize); | ||
| Math.max(container.getUsedBytes(), HddsUtils.requiredReplicationSpace(defaultContainerSize)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't 2x apply to the result of (the original) Example: if the container is 5GB and default size is 1GB, then we need 10GB on the datanode, not 5GB.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes makes sense, updated with (the original) |
||
|
|
||
| int mutableRequiredNodes = requiredNodes; | ||
| while (mutableRequiredNodes > 0) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code in
hdds-commonis shared between client and server.requiredReplicationSpaceis only for servers. Please move it toHddsServerUtil.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to
HddsServerUtil.