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

   ## What changes were proposed in this pull request?
   
   A SQL database failure causes ContainerSizeCountTask to exit permanently, 
leaving Recon's container size distribution stale until restart. Retrying alone 
is insufficient because the task updates its in-memory state before writing to 
the database, and a failed write may leave partially applied changes.
   
   This patch catches exceptions within the task loop, logs failures at ERROR, 
records the failed run status, and retries after the configured interval. When 
processing fails, it clears the in-memory container tracking so the next run 
truncates the table and rebuilds the counts, recovering from partial writes.
   
   ## What is the link to the Apache JIRA
   
   [HDDS-17065](https://issues.apache.org/jira/browse/HDDS-17065)
   
   ## How was this patch tested?
   
   Two regression tests were added and confirmed to fail before the fix:
   
   - testTaskKeepsRunningAfterFailedRun: verifies that the task retries and 
persists counts after an insert failure.
   - testCountsRecoverAfterFailedWrite: verifies that counts recover after an 
insert succeeds but the subsequent update fails.
   
   After the fix, all 7 tests in TestContainerSizeCountTask and 
TestReconTaskStatusUpdater passed. The full repository checkstyle script and 
git diff --check also passed.
   


-- 
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