Browse Source

HDFS-9655. NN should start JVM pause monitor before loading fsimage. (John Zhuge via Lei (Eddy) Xu)

(cherry picked from commit 2ec438e8f7cd77cb48fd1264781e60a48e331908)
Lei Xu 9 years ago
parent
commit
c57f55223c

+ 1 - 0
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/JvmPauseMonitor.java

@@ -185,6 +185,7 @@ public class JvmPauseMonitor extends AbstractService {
     public void run() {
     public void run() {
       StopWatch sw = new StopWatch();
       StopWatch sw = new StopWatch();
       Map<String, GcTimes> gcTimesBeforeSleep = getGcTimes();
       Map<String, GcTimes> gcTimesBeforeSleep = getGcTimes();
+      LOG.info("Starting JVM pause monitor");
       while (shouldRun) {
       while (shouldRun) {
         sw.reset().start();
         sw.reset().start();
         try {
         try {

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -932,6 +932,9 @@ Release 2.8.0 - UNRELEASED
     HDFS-9415. Document dfs.cluster.administrators and
     HDFS-9415. Document dfs.cluster.administrators and
     dfs.permissions.superusergroup. (Xiaobing Zhou via Arpit Agarwal)
     dfs.permissions.superusergroup. (Xiaobing Zhou via Arpit Agarwal)
 
 
+    HDFS-9655. NN should start JVM pause monitor before loading fsimage.
+    (John Zhuge via Lei (Eddy) Xu)
+
   OPTIMIZATIONS
   OPTIMIZATIONS
 
 
     HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than
     HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than

+ 6 - 6
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java

@@ -671,6 +671,11 @@ public class NameNode implements NameNodeStatusMXBean {
     NameNode.initMetrics(conf, this.getRole());
     NameNode.initMetrics(conf, this.getRole());
     StartupProgressMetrics.register(startupProgress);
     StartupProgressMetrics.register(startupProgress);
 
 
+    pauseMonitor = new JvmPauseMonitor();
+    pauseMonitor.init(conf);
+    pauseMonitor.start();
+    metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
+
     if (NamenodeRole.NAMENODE == role) {
     if (NamenodeRole.NAMENODE == role) {
       startHttpServer(conf);
       startHttpServer(conf);
     }
     }
@@ -690,12 +695,7 @@ public class NameNode implements NameNodeStatusMXBean {
       httpServer.setNameNodeAddress(getNameNodeAddress());
       httpServer.setNameNodeAddress(getNameNodeAddress());
       httpServer.setFSImage(getFSImage());
       httpServer.setFSImage(getFSImage());
     }
     }
-    
-    pauseMonitor = new JvmPauseMonitor();
-    pauseMonitor.init(conf);
-    pauseMonitor.start();
-    metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
-    
+
     startCommonServices(conf);
     startCommonServices(conf);
     startMetricsLogger(conf);
     startMetricsLogger(conf);
   }
   }