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


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AbstractReadOnlyController.java:
##########
@@ -61,8 +64,13 @@ public static void manageActiveClusterIdFile(boolean 
readOnlyEnabled, MasterFile
           activeClusterFile);
         try {
           if (fs.exists(activeClusterFile)) {
-            fs.delete(activeClusterFile, false);
-            LOG.info("Successfully deleted active cluster file: {}", 
activeClusterFile);
+            FSDataInputStream in = fs.open(activeClusterFile);
+            byte[] actualClusterFileData = IOUtils.toByteArray(in);
+            byte[] expectedClusterFileData = mfs.getSuffixFileDataToWrite();

Review Comment:
   Another nice catch. Getters should not mutate anything. Let's extract the 
mutation and move it to callers' level.



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