ritegarg commented on code in PR #2224:
URL: https://github.com/apache/phoenix/pull/2224#discussion_r2211173727


##########
phoenix-core-server/src/main/java/org/apache/phoenix/hbase/index/IndexRegionObserver.java:
##########
@@ -621,10 +623,16 @@ public void 
preBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c,
       }
       try {
           final Configuration conf = c.getEnvironment().getConfiguration();
-          final HAGroupStoreManager haGroupStoreManager = 
HAGroupStoreManager.getInstance(conf);
-          if (haGroupStoreManager.isMutationBlocked()) {
-              throw new IOException("Blocking Mutation as Some CRRs are in 
ACTIVE_TO_STANDBY "
-                      + "state and CLUSTER_ROLE_BASED_MUTATION_BLOCK_ENABLED 
is true");
+          final Optional<HAGroupStoreManager> haGroupStoreManagerOptional
+                  = HAGroupStoreManagerFactory.getInstance(conf);
+          if (!haGroupStoreManagerOptional.isPresent()) {
+              throw new IOException("HAGroupStoreManager is null "
+                      + "for current cluster, check configuration");
+          }
+          if (haGroupStoreManagerOptional.get().isMutationBlocked(conf)) {
+              throw new MutationBlockedIOException("Blocking Mutation as Some 
CRRs are in "

Review Comment:
   Fixed



-- 
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: issues-unsubscr...@phoenix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to