anmolnar commented on code in PR #6887:
URL: https://github.com/apache/hbase/pull/6887#discussion_r2031678045


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java:
##########
@@ -382,4 +382,58 @@ public void stop() {
   public void logFileSystemState(Logger log) throws IOException {
     CommonFSUtils.logFileSystemState(fs, rootdir, log);
   }
+
+  private void ensureHbaseClusterIdFileExists(long wait) throws IOException {
+    LOG.info("HBase cluster ID file");

Review Comment:
   Please remove this log line.



##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java:
##########
@@ -382,4 +382,58 @@ public void stop() {
   public void logFileSystemState(Logger log) throws IOException {
     CommonFSUtils.logFileSystemState(fs, rootdir, log);
   }
+
+  private void ensureHbaseClusterIdFileExists(long wait) throws IOException {
+    LOG.info("HBase cluster ID file");
+    if (!FSUtils.checkClusterIdExists(fs, rootdir, 
HConstants.CLUSTER_ID_FILE_NAME, wait)) {
+      FSUtils.setClusterId(fs, rootdir, HConstants.CLUSTER_ID_FILE_NAME, new 
ClusterId(), wait);
+    }
+    clusterId = FSUtils.getClusterId(fs, rootdir);
+  }
+
+  private void negotiateActiveClusterIdFile(long wait) throws IOException {
+    LOG.info("Active cluster ID file");

Review Comment:
   Please remove this log line.



##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java:
##########
@@ -382,4 +382,58 @@ public void stop() {
   public void logFileSystemState(Logger log) throws IOException {
     CommonFSUtils.logFileSystemState(fs, rootdir, log);
   }
+
+  private void ensureHbaseClusterIdFileExists(long wait) throws IOException {
+    LOG.info("HBase cluster ID file");
+    if (!FSUtils.checkClusterIdExists(fs, rootdir, 
HConstants.CLUSTER_ID_FILE_NAME, wait)) {
+      FSUtils.setClusterId(fs, rootdir, HConstants.CLUSTER_ID_FILE_NAME, new 
ClusterId(), wait);
+    }
+    clusterId = FSUtils.getClusterId(fs, rootdir);
+  }
+
+  private void negotiateActiveClusterIdFile(long wait) throws IOException {
+    LOG.info("Active cluster ID file");
+    boolean isReadOnlyModeEnabled = 
conf.getBoolean(HConstants.HBASE_GLOBAL_READONLY_ENABLED_KEY,
+      HConstants.HBASE_GLOBAL_READONLY_ENABLED_DEFAULT);
+    boolean activeClusterIdFileExists = FSUtils.checkClusterIdExists(
+      fs, rootdir, HConstants.ACTIVE_CLUSTER_ID_FILE_NAME, wait);
+
+    if (!isReadOnlyModeEnabled) {
+      // create active_cluster.id file if it does not exist
+      if (!activeClusterIdFileExists) {
+        FSUtils.setClusterId(
+          fs, rootdir, HConstants.ACTIVE_CLUSTER_ID_FILE_NAME, getClusterId(), 
wait);
+        LOG.info("Active Cluster id file created, cluster ID : {}", 
getClusterId());
+      } else {
+        // validate the cluster id
+        ClusterId cid = FSUtils.getClusterId(fs, rootdir);
+        if (cid.equals(getClusterId())) {
+          //change this to debug
+          LOG.info("Active cluster is being restarted, ID {}", cid);

Review Comment:
   No need to log this. It could have been a crash or something else and this 
could be misleading. This is normal startup anyways.



-- 
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]

Reply via email to