huaxiangsun commented on a change in pull request #2584:
URL: https://github.com/apache/hbase/pull/2584#discussion_r514396843



##########
File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncNonMetaRegionLocator.java
##########
@@ -577,6 +635,15 @@ private void removeLocationFromCache(HRegionLocation loc) {
       if (!canUpdateOnError(loc, oldLoc)) {
         return;
       }
+      // Tell metaReplicaSelector that the location is stale. It will create a 
stale entry
+      // with timestamp internally. Next time the client looks up the same 
location,
+      // it will pick a different meta replica region. For the current 
implementation,
+      // the metaReplicaId is not used, so the primary one is passed in.
+      if (this.metaReplicaMode == CatalogReplicaMode.LoadBalance) {
+        // metaReplicaId is not used in simpleSelector, default to the primary 
one.
+        metaReplicaSelector.onError(loc, RegionInfo.DEFAULT_REPLICA_ID);

Review comment:
       In my initial patch, I do keep "fromReplicaId" in TableCache to indicate 
which meta replica id the location comes from.
   However, this is not being used at this moment so I do not think it is a 
good idea to add more bytes which is not being used at this moment. How about 
passing an invalid replica id (say -1) to indicate it is not being filled at 
this moment?




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

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


Reply via email to