Skip to content

HDDS-15038. Clean up chunks before metadata for failed container import#10199

Open
devmadhuu wants to merge 1 commit intoapache:masterfrom
devmadhuu:HDDS-15038
Open

HDDS-15038. Clean up chunks before metadata for failed container import#10199
devmadhuu wants to merge 1 commit intoapache:masterfrom
devmadhuu:HDDS-15038

Conversation

@devmadhuu
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This PR handles failed container import cleanup on the DataNode. KeyValueContainer.cleanupFailedImport() now deletes the chunks/ directory before deleting the metadata/ directory. If cleanup is interrupted or partially fails between child-
directory deletions, the remaining on-disk state now preferentially preserves metadata instead of leaving a harder-to-diagnose chunks/-only residual directory.

A focused test was added to inject an import cleanup failure at metadata deletion and verify that chunks/ has already been removed while metadata/ remains.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-15038

How was this patch tested?

Added TestKeyValueContainer#testFailedImportCleanupDeletesChunksBeforeMetadata

@devmadhuu devmadhuu requested review from ChenSammi and errose28 May 6, 2026 07:44
@devmadhuu devmadhuu marked this pull request as ready for review May 6, 2026 09:53
@adoroszlai adoroszlai changed the title HDDS-15038. Change cleanupFailedImport() to delete chunks before metadata to avoid chunks-only residual state. HDDS-15038. Clean up chunks before metadata for failed container import May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant