Shilun Fan created HDDS-15291:
---------------------------------

             Summary: DN should fail unreferenced block deletion on file errors
                 Key: HDDS-15291
                 URL: https://issues.apache.org/jira/browse/HDDS-15291
             Project: Apache Ozone
          Issue Type: Improvement
          Components: Ozone Datanode
            Reporter: Shilun Fan
            Assignee: Shilun Fan


Datanode may silently ignore failures while cleaning up unreferenced 
block/chunk files during block deletion.

In KeyValueHandler.deleteUnreferenced, the current implementation lists chunk 
files by prefix and deletes matching files with FileUtil.fullyDelete(file).

However, it does not handle two failure cases explicitly:
 * File.list(...) may return null if the chunk directory cannot be listed.
 * FileUtil.fullyDelete(file) returns false when deletion fails, but the result 
is currently ignored.

As a result, DN may log that an unreferenced chunk/block was deleted even when 
the file deletion actually failed. This can make cleanup failures harder to 
detect and may leave stale unreferenced files on disk.

The proposed fix is to make deleteUnreferenced fail explicitly by throwing 
IOException when the chunk directory cannot be listed or when file deletion 
fails, and only log successful deletion after the file is actually removed.

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to