[ https://issues.apache.org/jira/browse/HDFS-13475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16540682#comment-16540682 ]
Chao Sun commented on HDFS-13475: --------------------------------- Thanks [~elgoiri]. I think we still need two flags still: one {{safeMode}} and another {{isSafeModeSetManually}}, but we can set them together in {{setManualSafeMode(true)}} and remove {{setSafeMode()}}. One question related to the test failures though: after we move the logic to {{RouterSafemodeService}}, enter/leave/get safe mode will no longer be effective *if* the safe mode service is disabled. We also need to check several places on the result of {{getSafemodeService}} before we call any method on the service. Let me know if you are OK with this. > RBF: Admin cannot enforce Router enter SafeMode > ----------------------------------------------- > > Key: HDFS-13475 > URL: https://issues.apache.org/jira/browse/HDFS-13475 > Project: Hadoop HDFS > Issue Type: Sub-task > Reporter: Wei Yan > Assignee: Chao Sun > Priority: Major > Attachments: HDFS-13475.000.patch, HDFS-13475.001.patch > > > To reproduce the issue: > {code:java} > $ bin/hdfs dfsrouteradmin -safemode enter > Successfully enter safe mode. > $ bin/hdfs dfsrouteradmin -safemode get > Safe Mode: true{code} > And then, > {code:java} > $ bin/hdfs dfsrouteradmin -safemode get > Safe Mode: false{code} > From the code, it looks like the periodicInvoke triggers the leave. > {code:java} > public void periodicInvoke() { > ...... > // Always update to indicate our cache was updated > if (isCacheStale) { > if (!rpcServer.isInSafeMode()) { > enter(); > } > } else if (rpcServer.isInSafeMode()) { > // Cache recently updated, leave safe mode > leave(); > } > } > {code} > > -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org