kadirozde commented on code in PR #2288:
URL: https://github.com/apache/phoenix/pull/2288#discussion_r2440954896
##########
phoenix-core-server/src/main/java/org/apache/phoenix/hbase/index/IndexRegionObserver.java:
##########
@@ -634,12 +635,24 @@ public void
preBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c,
final Set<String> haGroupNames =
extractHAGroupNameAttribute(miniBatchOp);
// Check if mutation is blocked for any of the HAGroupNames
for (String haGroupName : haGroupNames) {
- if (StringUtils.isNotBlank(haGroupName)
- && haGroupStoreManager.isMutationBlocked(haGroupName)) {
- throw new MutationBlockedIOException("Blocking Mutation as
Some CRRs are in "
- + "ACTIVE_TO_STANDBY state and "
- + "CLUSTER_ROLE_BASED_MUTATION_BLOCK_ENABLED is
true");
- }
+ //TODO: Below approach might be slow need to figure out faster
way, slower part is
+ //getting haGroupStoreClient We can also cache roleRecord (I
tried it and still its
+ //slow due to haGroupStoreClient initialization) and caching
will give us old result
+ //in case one cluster is unreachable instead of UNKNOWN. Check
if mutation's
+ //haGroup is stale
+ boolean isHAGroupOnClientStale = haGroupStoreManager
Review Comment:
The Phoenix client will refresh if it gets a
StaleClusterRoleRecordException. We (@lokiore and I) decided that the client
should not retry in this case, instead it will return a SQL exception to the
client and in turn the client will close the current connection. This is
because if the current cluster is not the right cluster for this mutation, then
a new Phoenix connection needs to be opened using the right HBase connection.
In this case the application needs to close the old connection and open a new
connection and continue to execute the operations using the new Phoenix
connection context. In future, we may try to improve this behavior but it is
not straightforward to switch an application connection from one cluster to
another and resubmit the pending operation.
--
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]