Uh oh!
There was an error while loading. Please reload this page.
HDDS-12998. Bring real container size in pb message when exporting/importing containers - #8915
Conversation
Gargi-jais11
commented
Aug 14, 2025
@peterxcli can you please review it. |
Uh oh!
There was an error while loading. Please reload this page.
peterxcli
left a comment
There was a problem hiding this comment.
Thanks @Gargi-jais11 for this patch, left some comments, PTAL.
Also please could you try add some test coverage on your change? Thanks!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Gargi-jais11
commented
Aug 19, 2025
Ok |
peterxcli
left a comment
There was a problem hiding this comment.
Sorry my previous idea might be wrong.
Uh oh!
There was an error while loading. Please reload this page.
77a46c7 to
96e8afdCompare
peterxcli
left a comment
There was a problem hiding this comment.
Thanks @Gargi-jais11 for the prompt update. Haven't looked into the test code, but the prod code looks good.
Left some comments/suggestions/questions, please take a look.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
peterxcli
commented
Sep 4, 2025
please request my review whenever you think this is ready :) |
@peterxcli you can review the patch whenever you are free. |
peterxcli
left a comment
There was a problem hiding this comment.
Thanks for updating the patch! Only some minor comments left.
Btw, could we add some IT coverage in TestContainerCoverage with sth like the below?
@ParameterizedTest@EnumSourcevoidtestPushWithReplicateSize(CopyContainerCompressioncompression) throwsException {
finalintindex = compression.ordinal();
DatanodeDetailssource = cluster.getHddsDatanodes().get(index).getDatanodeDetails();
longcontainerID = createNewClosedContainer(source);
DatanodeDetailstarget = selectOtherNode(source);
ReplicateContainerCommandcmd = ReplicateContainerCommand.toTarget(containerID, target);
cmd.setReplicateSize(2L * 1024 * 1024 * 1024); // example valuequeueAndWaitForCompletion(cmd, source, ReplicationSupervisor::getReplicationSuccessCount);
}
@ParameterizedTest@EnumSourcevoidtestPullWithReplicateSize(CopyContainerCompressioncompression) throwsException {
finalintindex = compression.ordinal();
DatanodeDetailstarget = cluster.getHddsDatanodes().get(index).getDatanodeDetails();
DatanodeDetailssource = selectOtherNode(target);
longcontainerID = createNewClosedContainer(source);
ReplicateContainerCommandcmd =
ReplicateContainerCommand.fromSources(containerID, ImmutableList.of(source));
cmd.setReplicateSize(2L * 1024 * 1024 * 1024);
queueAndWaitForCompletion(cmd, target, ReplicationSupervisor::getReplicationSuccessCount);
}I guess the fallback path has been cover by the old tests in TestContainerReplication? so "with replicate size" tests should be enough.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
peterxcli
commented
Sep 9, 2025
Then I think this is good to merge! cc @ChenSammi@siddhantsangwan Would you like to take another look? |
Gargi-jais11
commented
Sep 10, 2025
Do you mean adding in |
yes... sorry for the typo and thanks for the correction... |
Gargi-jais11
commented
Sep 10, 2025
No issues, it happens. |
siddhantsangwan
left a comment
There was a problem hiding this comment.
Any particular reason for sending the container's size from the SCM to the Datanode? It's simpler to just get the size from the Datanode's in-memory state.
Gargi-jais11
commented
Sep 11, 2025
But I think how can we get size on Datanode side while choosing volume in the below place, so its better to send replicate size from SCM. Since in chhoseNextVolume we need to pass size in order to reserve space. |
siddhantsangwan
commented
Sep 19, 2025
We don't need to make changes to pull replication ( Moreover, datanode knows the correct size of the container. SCM's knowledge of the container's size is outdated if there have been block deletions and the size has reduced. |
Gargi-jais11
commented
Sep 19, 2025
Thank you @siddhantsangwan for this information. I will do changes according to push replication. |
peterxcli
commented
Sep 19, 2025
Thanks @siddhantsangwan for the explanation!
@Gargi-jais11 I think we almost there, we just need to
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
siddhantsangwan
commented
Sep 22, 2025
Another way is to get the container's size in ReplicateContainerCommandHandler#handle and use a setter to set that in |
…push replicator only
68759d4 to
80a84e3Compare80a84e3 to
e6c799eCompareGargi-jais11
commented
Sep 22, 2025
Sorry, but I didn't saw this comment before changing the code. @siddhantsangwan and @peterxcli . |
Gargi-jais11
commented
Sep 22, 2025
Here is an analysis of both the approaches to get container Size to Push Replicator.
Now considering Test analysis of this approach :- |
Gargi-jais11
commented
Sep 22, 2025
So this approach adds 3 steps extra which can be avoided. And for this we need to add multiple test cases for PushReplicator class as well. |
@siddhantsangwan and @peterxcli |
siddhantsangwan
commented
Sep 22, 2025
I agree, based on this we can go ahead with the first approach. |
siddhantsangwan
commented
Sep 22, 2025
@Gargi-jais11 it'd be good to also have some kind of integration testing (whichever way is the easiest) that ensures this change works as intended across two Datanodes. |
Gargi-jais11
commented
Sep 22, 2025
Okay sure. I will add IT. |
ee89ecf to
e0ef830Comparee0ef830 to
7e42b8bComparesiddhantsangwan
commented
Sep 25, 2025
@Gargi-jais11 please avoid force pushing when possible because with force push reviewers can't know what all has changed since the last review. |
siddhantsangwan
left a comment
There was a problem hiding this comment.
Mostly looks good, just a few minor comments.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
siddhantsangwan
left a comment
There was a problem hiding this comment.
LGTM, pending green CI.
Uh oh!
There was an error while loading. Please reload this page.
What changes were proposed in this pull request?
Generally, the tar zip file of container will have smaller size than it's real size, so reserve a 2* max container size is conservative enough in most cases. But there are container over-allocated case, where container size can be double or triple the max container size as @siddhantsangwan saw in user's environment, have a accurate container size can handle this case welly, and that info could be brought in
For backward compatibility, if that field unset, fallback to get the container size from config.
comments:
#8360 (comment)
#8360 (comment)
#8360 (comment)
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-12998
How was this patch tested?
Updated existing UT.
TestPushReplicatorTestSendContainerRequestHandlerTestDownloadAndImportReplicator