HDFS-8114. Erasure coding: Add auditlog FSNamesystem#createErasureCodingZone if this operation fails. Contributed by Rakesh R.
This commit is contained in:
parent
a32c4dc38a
commit
3b56a5aa9e
|
@ -7531,11 +7531,19 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
||||||
SafeModeException, AccessControlException {
|
SafeModeException, AccessControlException {
|
||||||
String src = srcArg;
|
String src = srcArg;
|
||||||
HdfsFileStatus resultingStat = null;
|
HdfsFileStatus resultingStat = null;
|
||||||
checkSuperuserPrivilege();
|
FSPermissionChecker pc = null;
|
||||||
checkOperation(OperationCategory.WRITE);
|
byte[][] pathComponents = null;
|
||||||
final byte[][] pathComponents =
|
boolean success = false;
|
||||||
FSDirectory.getPathComponentsForReservedPath(src);
|
try {
|
||||||
FSPermissionChecker pc = getPermissionChecker();
|
checkSuperuserPrivilege();
|
||||||
|
checkOperation(OperationCategory.WRITE);
|
||||||
|
pathComponents =
|
||||||
|
FSDirectory.getPathComponentsForReservedPath(src);
|
||||||
|
pc = getPermissionChecker();
|
||||||
|
} catch (Throwable e) {
|
||||||
|
logAuditEvent(success, "createErasureCodingZone", srcArg);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
writeLock();
|
writeLock();
|
||||||
try {
|
try {
|
||||||
checkSuperuserPrivilege();
|
checkSuperuserPrivilege();
|
||||||
|
@ -7549,11 +7557,12 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
||||||
getEditLog().logSetXAttrs(src, xAttrs, logRetryCache);
|
getEditLog().logSetXAttrs(src, xAttrs, logRetryCache);
|
||||||
final INodesInPath iip = dir.getINodesInPath4Write(src, false);
|
final INodesInPath iip = dir.getINodesInPath4Write(src, false);
|
||||||
resultingStat = dir.getAuditFileInfo(iip);
|
resultingStat = dir.getAuditFileInfo(iip);
|
||||||
|
success = true;
|
||||||
} finally {
|
} finally {
|
||||||
writeUnlock();
|
writeUnlock();
|
||||||
}
|
}
|
||||||
getEditLog().logSync();
|
getEditLog().logSync();
|
||||||
logAuditEvent(true, "createErasureCodingZone", srcArg, null, resultingStat);
|
logAuditEvent(success, "createErasureCodingZone", srcArg, null, resultingStat);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue