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/03/16 09:13:00 UTC
[jira] [Updated] (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 updated HDDS-4987:
-----------------------------
Description:
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
was:
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}
> 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
>
> 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