priyeshkaratha opened a new pull request, #10565:
URL: https://github.com/apache/ozone/pull/10565

   ## What changes were proposed in this pull request?
   
   When the container metadata scanner detects a MISSING_METADATA_DIR 
corruption, it attempts to persist the UNHEALTHY state by writing the 
.container file. However, writeToContainerFile creates a temp file inside the 
metadata directory itself — the very directory that is missing — causing a 
secondary StorageContainerException: Failed to create tmp file. This produces a 
spurious WARN and leaves the UNHEALTHY state un-persisted on disk; the state is 
lost on the next datanode restart.
   
   The fix adds a single guard in KeyValueContainer.writeToContainerFile: if 
the metadata directory does not exist, recreate it with mkdirs() before 
attempting to create the temp file. This allows the .container file to be 
written and the UNHEALTHY state to survive a restart.
   
   ## What is the link to the Apache JIRA
   
   HDDS-14577
   
   ## How was this patch tested?
   
   Added new testcases
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to