-
Notifications
You must be signed in to change notification settings - Fork 621
HDDS-7083. Spread container-copy directories #3648
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
Merged
Merged
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
db0cf77
HDDS-7083. Spread container-copy directories
symious ea07251
HDDS-7083. Add config in ozone-default.xml
symious e5c0a34
HDDS-7083. Enable spread volume feature by default
symious 75e9f8d
HDDS-7083. Deprecate configuration and use tmp/container-copy directory
symious 1cc345d
HDDS-7083. Fix config test
symious 14d3e00
HDDS-7083. Add deprecated key
symious 615070d
HDDS-7083. Download, untar, move, then load container
symious 417fd4b
HDDS-7083. Unit test to be fixed
symious 1ef25a4
HDDS-7083. parameter not to create dir when initializing
symious 4bfa4df
HDDS-7083. Fix unit test
symious f590482
trigger new CI check
symious 8cb4030
trigger new CI check
symious dfd161d
trigger new CI check
symious e551a67
Merge branch 'master' into HDDS-7083
symious 205d6a3
HDDS-7083. Remove unused import
symious fc6bee4
Merge branch 'master' into HDDS-7083
symious cc5dcdf
Merge branch 'master' into HDDS-7083
symious 4ecff14
HDDS-7083. Fix according to comments
symious 2207a50
Merge branch 'master' into HDDS-7083
symious a5c34fe
HDDS-7083. Remove duplicated import
symious 299d0f6
HDDS-7083. Delete tmp direcotry
symious c62d37f
HDDS-7083. Delete temporary files
symious e8f036e
HDDS-7083. Throw proper exception
symious 5806f6c
HDDS-7083. Clean tmp data
symious 0f1780d
HDDS-7083. Remove unused import
symious File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -381,13 +381,16 @@ ContainerCommandResponseProto handleCreateContainer( | |
| return getSuccessResponse(request); | ||
| } | ||
|
|
||
| private void populateContainerPathFields(KeyValueContainer container) | ||
| throws IOException { | ||
| private void populateContainerPathFields(KeyValueContainer container, | ||
| HddsVolume hddsVolume) throws IOException { | ||
| volumeSet.readLock(); | ||
| HddsVolume containerVolume = hddsVolume; | ||
| try { | ||
| HddsVolume containerVolume = volumeChoosingPolicy.chooseVolume( | ||
| StorageVolumeUtil.getHddsVolumesList(volumeSet.getVolumesList()), | ||
| container.getContainerData().getMaxSize()); | ||
| if (hddsVolume == null) { | ||
|
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. hddsVolume should not be null here. We need to make sure that in container.importContainerData, tmpDir and DownloadAndImportReplicator.getUntarDirectory(hddsVolume) are on the same volume so that atomic Files.move will not fail. |
||
| containerVolume = volumeChoosingPolicy.chooseVolume( | ||
| StorageVolumeUtil.getHddsVolumesList(volumeSet.getVolumesList()), | ||
| container.getContainerData().getMaxSize()); | ||
| } | ||
| String idDir = VersionedDatanodeFeatures.ScmHA.chooseContainerPathID( | ||
| containerVolume, clusterId); | ||
| container.populatePathFields(idDir, containerVolume); | ||
|
|
@@ -1014,8 +1017,7 @@ private void checkContainerOpen(KeyValueContainer kvContainer) | |
| @Override | ||
| public Container importContainer(ContainerData originalContainerData, | ||
| final InputStream rawContainerStream, | ||
| final TarContainerPacker packer) | ||
| throws IOException { | ||
| final TarContainerPacker packer) throws IOException { | ||
| Preconditions.checkState(originalContainerData instanceof | ||
| KeyValueContainerData, "Should be KeyValueContainerData instance"); | ||
|
|
||
|
|
@@ -1025,7 +1027,8 @@ public Container importContainer(ContainerData originalContainerData, | |
| KeyValueContainer container = new KeyValueContainer(containerData, | ||
| conf); | ||
|
|
||
| populateContainerPathFields(container); | ||
| HddsVolume targetVolume = originalContainerData.getVolume(); | ||
| populateContainerPathFields(container, targetVolume); | ||
| container.importContainerData(rawContainerStream, packer); | ||
| sendICR(container); | ||
| return container; | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
This LOG is not used in anywhere. We can revert this change in this file.
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.
This comment is not addressed yet.