Skip to content

HDDS-15291. DN should fail unreferenced block deletion on file errors.#10291

Open
slfan1989 wants to merge 1 commit into
apache:masterfrom
slfan1989:HDDS-15291
Open

HDDS-15291. DN should fail unreferenced block deletion on file errors.#10291
slfan1989 wants to merge 1 commit into
apache:masterfrom
slfan1989:HDDS-15291

Conversation

@slfan1989
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This PR makes DN fail unreferenced block deletion when chunk listing or file deletion fails.

During unreferenced block cleanup, KeyValueHandler.deleteUnreferenced previously assumed that the chunk directory listing always succeeded and did not check the return value of FileUtil.fullyDelete. As a result, DN could log an unreferenced chunk/block as deleted even when the file was not actually removed from disk.

This change makes the cleanup path fail explicitly when:

  • the chunk directory cannot be listed;
  • an unreferenced chunk/block file cannot be deleted.

The success log is emitted only after the file deletion succeeds.
This avoids silently treating failed cleanup as successful and makes the failure visible to callers/logs.

What is the link to the Apache JIRA

JIRA: HDDS-15291. DN should fail unreferenced block deletion on file errors.

How was this patch tested?

Add Junit Test.

https://github.com/slfan1989/ozone/actions/runs/25953412303

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