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


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AbstractReadOnlyController.java:
##########
@@ -99,13 +100,14 @@ public static void manageActiveClusterIdFile(boolean 
readOnlyEnabled, MasterFile
             "Failed to delete active cluster file: {}. "
               + "Read-only flag will be updated, but file system state is 
inconsistent.",
             activeClusterFile, e);
+        } catch (DeserializationException e) {
+          LOG.error("Failed to deserialize ActiveClusterSuffix from file {}", 
activeClusterFile, e);
         }
       } else {
         // DISABLING READ-ONLY (true -> false), create the active cluster file 
id file
         int wait = 
mfs.getConfiguration().getInt(HConstants.THREAD_WAKE_FREQUENCY, 10 * 1000);
         if (!fs.exists(activeClusterFile)) {
-          FSUtils.setActiveClusterSuffix(fs, rootDir, 
mfs.computeAndSetSuffixFileDataToWrite(),
-            wait);
+          FSUtils.setActiveClusterSuffix(fs, rootDir, 
mfs.getActiveClusterSuffix(), wait);
         } else {
           LOG.debug("Active cluster file already exists at: {}. No need to 
create it again.",
             activeClusterFile);

Review Comment:
   I see an implementation gap here as well. Being the file present alone 
doesn't guarantee that we could enable read-write mode. We need to make sure 
that suffix file contains the suffix of this cluster.



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