sumitagrawl commented on code in PR #8311: URL: https://github.com/apache/ozone/pull/8311#discussion_r2053679855
########## hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMClientProtocolServer.java: ########## @@ -1048,6 +1048,25 @@ public boolean forceExitSafeMode() throws IOException { } } + /** + * Allow SCM to enter Safe mode. + * + * @return returns true if operation is successful. + * @throws IOException In case of exception while checking admin access + */ + @Override + public boolean enterSafeMode() throws IOException { + try { + getScm().checkAdminAccess(getRemoteUser(), false); + boolean result = scm.enterSafeMode(); + AUDIT.logWriteSuccess(buildAuditMessageForSuccess(SCMAction.IN_SAFE_MODE, null)); Review Comment: This audit is to specific status if in safe mode during GET. Need separate audit for ENTRY / Force Exist ########## hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/safemode/SCMSafeModeManager.java: ########## @@ -85,6 +85,7 @@ public class SCMSafeModeManager implements SafeModeManager { LoggerFactory.getLogger(SCMSafeModeManager.class); private final boolean isSafeModeEnabled; private AtomicBoolean inSafeMode = new AtomicBoolean(true); + private AtomicBoolean inManualSafeMode = new AtomicBoolean(false); Review Comment: we do not need have another variable in code to represent inSafeMode, can update same varialbe inSafeMode. ########## hadoop-hdds/interface-admin/src/main/proto/ScmAdminProtocol.proto: ########## @@ -196,6 +198,7 @@ enum Type { GetContainersOnDecomNode = 42; GetMetrics = 43; GetContainerBalancerStatusInfo = 44; + InManualSafeMode = 45; Review Comment: This needs to be EnterSafeMode as request type. -- 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