yandrey321 commented on code in PR #9207:
URL: https://github.com/apache/ozone/pull/9207#discussion_r2470111147


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskDbEventHandler.java:
##########
@@ -96,6 +98,14 @@ protected void handlePutKeyEvent(OmKeyInfo keyInfo, Map<Long,
       // If we don't have it locally and in the DB we create a new instance
       // as this is a new ID
       nsSummary = new NSSummary();
+      // Look up the parent directory info from OM to get its parentId
+      // This ensures the propagation chain is not broken
+      // Below logic will handles edge cases where events might arrive out of 
order or in different batches
+      OmDirectoryInfo parentDirInfo = getParentDirInfo(parentObjectId);
+      if (parentDirInfo != null) {
+        nsSummary.setParentId(parentDirInfo.getParentObjectID());
+        nsSummary.setDirName(parentDirInfo.getName());
+      }

Review Comment:
   what if parentDirInfo is null? At least it should be logged and treated as 
metadata consistency issue.



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