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


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/storefiletracker/StoreFileTrackerBase.java:
##########
@@ -98,7 +101,10 @@ public final void add(Collection<StoreFileInfo> newFiles) 
throws IOException {
   @Override
   public final void replace(Collection<StoreFileInfo> compactedFiles,
     Collection<StoreFileInfo> newFiles) throws IOException {
-    if (isPrimaryReplica) {
+    if (
+      isPrimaryReplica && 
!conf.getBoolean(HConstants.HBASE_GLOBAL_READONLY_ENABLED_KEY,
+        HConstants.HBASE_GLOBAL_READONLY_ENABLED_DEFAULT)
+    ) {

Review Comment:
   If you want to clone the behavior of secondary replicas for the read-only 
mode, which makes perfect sense to me, I think you should follow it everywhere 
in this class. In addition to add(), set() and replace() methods, you might 
want to add the same safeguard to `createWriter()` method as well. Could be 
also useful to extract the check in a separate method to reduce code 
duplication.



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