ArafatKhan2198 opened a new pull request, #12092: URL: https://github.com/apache/ozone/pull/12092
## What changes were proposed in this pull request? ### Summary When Recon processes an FSO directory rename, the OM delta can deliver the PUT for the new path before the DELETE of the old path. In that order, `handleDeleteDirEvent` used to always clear the directory’s parent link and drop it from the old parent’s children, even though the PUT had already attached it under the new name. OM stays correct; only Recon’s namespace summary is wrong until a full rebuild. This PR limits unlinking: the delete handler only clears `parentId` and removes the child link when the directory’s stored summary still matches the deleted key (same parent and same name). If the PUT ran first, totals are still adjusted on the old parent, but the directory stays linked where the PUT put it. ### Why - OM records a rename as DELETE (old key) + PUT (new key) in one batch. - `RDBBatchOperation` writes those records in key hash order, not call order, so Recon may see PUT before DELETE. - The unconditional unlink (from HDDS-13432) breaks parent links, bucket totals, paths, and later deletes for roughly half of rename key pairs (PUT-first cases). ### Approach - Change is limited to `NSSummaryTaskDbEventHandler.handleDeleteDirEvent` in Recon; no OM or batch-layer changes. - Real deletes, in-place UPDATEs, and renames where DELETE comes first behave as before. ### Tests - `testProcessDirRenameInEitherEventOrder` in `TestNSSummaryTaskWithFSO`: same-parent and cross-parent renames, PUT-first and DELETE-first. - `testProcessDirDeleteRename` extended to assert a deleted directory (`dir3`) is still unlinked (`parentId == 0`). --- ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-17044 --- ## How was this patch tested? - Unit tests `TestNSSummaryTaskWithFSO` ran successfully. -- 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]
