zingdle commented on code in PR #8849:
URL: https://github.com/apache/incubator-doris/pull/8849#discussion_r844661271
##########
fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/PaloAuth.java:
##########
@@ -1076,20 +1096,25 @@ private void createRoleInternal(String role, boolean
isReplay) throws DdlExcepti
// drop role
public void dropRole(DropRoleStmt stmt) throws DdlException {
- dropRoleInternal(stmt.getQualifiedRole(), false);
+ dropRoleInternal(stmt.getQualifiedRole(), stmt.isSetIfExists(), false);
}
public void replayDropRole(PrivInfo info) {
try {
- dropRoleInternal(info.getRole(), true);
+ dropRoleInternal(info.getRole(), false, true);
} catch (DdlException e) {
LOG.error("should not happened", e);
}
}
- private void dropRoleInternal(String role, boolean isReplay) throws
DdlException {
+ private void dropRoleInternal(String role, boolean ignoreIfNonExists,
boolean isReplay) throws DdlException {
writeLock();
try {
+ if (ignoreIfNonExists && roleManager.getRole(role) == null) {
+ LOG.info("role non exists, ignored to drop role: {}, is
replay: {}", role, isReplay);
Review Comment:
yes, I copy and paste these log statements from nearby. Noticed that
`LOG.debug` and `LOG.info` are mixed.
--
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]