HDFS-16937. Delete RPC should also record number of delete blocks in audit log

This commit is contained in:
admin 2023-02-28 14:48:50 +08:00
parent 0ca5686034
commit e5fd64503d
1 changed files with 5 additions and 1 deletions

View File

@ -3383,7 +3383,11 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
throw e;
}
getEditLog().logSync();
logAuditEvent(ret, operationName, src);
int toRemovedBlocksNum = 0;
if (toRemovedBlocks != null) {
toRemovedBlocksNum = toRemovedBlocks.getToDeleteList().size();
}
logAuditEvent(ret, operationName + ":" + toRemovedBlocksNum, src);
if (toRemovedBlocks != null) {
blockManager.addBLocksToMarkedDeleteQueue(
toRemovedBlocks.getToDeleteList());