You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Sammi Chen (Jira)" <ji...@apache.org> on 2021/04/01 09:39:00 UTC
[jira] [Resolved] (HDDS-4987) Import container should not delete
container contents if container already exists
[ https://issues.apache.org/jira/browse/HDDS-4987?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sammi Chen resolved HDDS-4987.
------------------------------
Fix Version/s: 1.2.0
Resolution: Fixed
> Import container should not delete container contents if container already exists
> ---------------------------------------------------------------------------------
>
> Key: HDDS-4987
> URL: https://issues.apache.org/jira/browse/HDDS-4987
> Project: Apache Ozone
> Issue Type: Bug
> Reporter: Sammi Chen
> Assignee: Sammi Chen
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.2.0
>
>
> KeyValueContainer # importContainerData
> {code:java}
> if (getContainerFile().exists()) {
> String errorMessage = String.format(
> "Can't import container (cid=%d) data to a specific location"
> + " as the container descriptor (%s) has already been exist.",
> getContainerData().getContainerID(),
> getContainerFile().getAbsolutePath());
> throw new IOException(errorMessage);
> }
> ....
> catch (Exception ex) {
> //delete all the temporary data in case of any exception.
> try {
> FileUtils.deleteDirectory(new File(containerData.getMetadataPath()));
> FileUtils.deleteDirectory(new File(containerData.getChunksPath()));
> FileUtils.deleteDirectory(getContainerFile());
> } catch (Exception deleteex) {
> LOG.error(
> "Can not cleanup destination directories after a container import"
> + " error (cid" +
> containerData.getContainerID() + ")", deleteex);
> }
> throw ex;
> {code}
> That's one of the reason why DN report empty container directories during startup.
> 2021-03-16 16:26:58,337 [Thread-9] ERROR org.apache.hadoop.ozone.container.ozoneimpl.ContainerReader: Missing .container file for ContainerID: 112224
> 2021-03-16 16:26:58,433 [Thread-9] ERROR org.apache.hadoop.ozone.container.ozoneimpl.ContainerReader: Missing .container file for ContainerID: 11913
> 2021-03-16 16:26:58,474 [Thread-9] ERROR org.apache.hadoop.ozone.container.ozoneimpl.ContainerReader: Missing .container file for ContainerID: 11823
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org