Kota-SH commented on code in PR #7881:
URL: https://github.com/apache/hbase/pull/7881#discussion_r2907834910
##########
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:
getSuffixFileDataToWrite() mutates activeClusterSuffix in
MasterFileSystem.java (line#453). Would this have any unintended side effects?
Because currently for read only clusters, this.activeClusterSuffix value is
not set in MasterFileSystem.java but this PR changes it.
> public byte[] getSuffixFileDataToWrite() {
> String str = getClusterId().toString() + ":" +
getActiveClusterSuffixFromConfig(conf);
> this.activeClusterSuffix = new ActiveClusterSuffix(str);
> return str.getBytes(StandardCharsets.UTF_8);
> }
--
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]