ArafatKhan2198 commented on code in PR #8797: URL: https://github.com/apache/ozone/pull/8797#discussion_r2254488648
########## hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskDbEventHandler.java: ########## @@ -153,39 +163,82 @@ protected void handleDeleteKeyEvent(OmKeyInfo keyInfo, LOG.error("The namespace table is not correctly populated."); return; } - int[] fileBucket = nsSummary.getFileSizeBucket(); - - int binIndex = ReconUtils.getFileSizeBinIndex(keyInfo.getDataSize()); - - // decrement count, data size, and bucket count - // even if there's no direct key, we still keep the entry because - // we still need children dir IDs info + + // Decrement immediate parent's totals nsSummary.setNumOfFiles(nsSummary.getNumOfFiles() - 1); nsSummary.setSizeOfFiles(nsSummary.getSizeOfFiles() - keyInfo.getDataSize()); - --fileBucket[binIndex]; - nsSummary.setFileSizeBucket(fileBucket); + + int binIndex = ReconUtils.getFileSizeBinIndex(keyInfo.getDataSize()); + int[] fileSizeBucket = nsSummary.getFileSizeBucket(); + fileSizeBucket[binIndex]--; + nsSummary.setFileSizeBucket(fileSizeBucket); nsSummaryMap.put(parentObjectId, nsSummary); + + // Propagate the change upwards + int[] bucketDeltas = new int[ReconConstants.NUM_OF_FILE_SIZE_BINS]; Review Comment: Done. -- 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: issues-unsubscr...@ozone.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org