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


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AbstractReadOnlyController.java:
##########
@@ -61,7 +64,12 @@ public static void manageActiveClusterIdFile(boolean 
readOnlyEnabled, MasterFile
           activeClusterFile);
         try {
           if (fs.exists(activeClusterFile)) {
-            fs.delete(activeClusterFile, false);
+            FSDataInputStream in = fs.open(activeClusterFile);
+            byte[] actualClusterFileData = IOUtils.toByteArray(in);
+            byte[] expectedClusterFileData = mfs.getSuffixFileDataToWrite();
+            if (Arrays.equals(actualClusterFileData, expectedClusterFileData)) 
{
+              fs.delete(activeClusterFile, false);

Review Comment:
   The LOG message should be inside the IF branch, because that's the case when 
you actually delete the file.
   



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