You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2021/11/08 19:26:17 UTC

[GitHub] [hbase] virajjasani commented on a change in pull request #3826: HBASE-26433 Rollback from ZK-less to ZK-based assignment could produce inconsistent state - doubly assigned regions

virajjasani commented on a change in pull request #3826:
URL: https://github.com/apache/hbase/pull/3826#discussion_r745027686



##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStateStore.java
##########
@@ -73,9 +73,11 @@
    * @return A ServerName instance or {@link HRegionInfo#getServerName(Result)}
    * if necessary fields not found or empty.
    */
-  static ServerName getRegionServer(final Result r, int replicaId) {
+  static ServerName getRegionServer(final Result r, int replicaId, Configuration config) {
     Cell cell = r.getColumnLatestCell(HConstants.CATALOG_FAMILY, getServerNameColumn(replicaId));
-    if (cell == null || cell.getValueLength() == 0) {
+    boolean isZKAssignmentInUse = ConfigUtil.useZKForAssignment(config) && !config
+      .getBoolean("hbase.assignment.usezk.migrating", false);
+    if (cell == null || cell.getValueLength() == 0 || isZKAssignmentInUse) {

Review comment:
       The intention is:
   if (migrating to non-zk or enabled non-zk) => use `info:sn` if available, else use `info:server` as usual.
   if (usezk) => never use `info:sn`, hence `isZKAssignmentInUse` is added with `||` condition so that if condition will always be true even if `info:sn` has non-empty value for ZK based assignment.




-- 
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-unsubscribe@hbase.apache.org

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