[ https://issues.apache.org/jira/browse/HBASE-22009?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16796293#comment-16796293 ]
Xiang Li commented on HBASE-22009: ---------------------------------- Hi [~xucang], I found this patch seems not workable in branch-1. It makes TestRSGroupsBasics#testClearDeadServers() failed, not at the verification points but at afterMethold(), with the following error: {code:java} [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 15.97 s <<< FAILURE! - in org.apache.hadoop.hbase.rsgroup.TestRSGroupsBasics [ERROR] testClearDeadServers(org.apache.hadoop.hbase.rsgroup.TestRSGroupsBasics) Time elapsed: 3.59 s <<< ERROR! org.apache.hadoop.hbase.constraint.ConstraintException: org.apache.hadoop.hbase.constraint.ConstraintException: Target group is the same as source group: default at org.apache.hadoop.hbase.rsgroup.RSGroupAdminServer.moveServers(RSGroupAdminServer.java:169) at org.apache.hadoop.hbase.rsgroup.RSGroupAdminEndpoint.moveServers(RSGroupAdminEndpoint.java:216) at org.apache.hadoop.hbase.protobuf.generated.RSGroupAdminProtos$RSGroupAdminService.callMethod(RSGroupAdminProtos.java:13870) at org.apache.hadoop.hbase.master.MasterRpcServices.execMasterService(MasterRpcServices.java:711) at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java:63436) at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2380) at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:124) at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:297) at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:277) at org.apache.hadoop.hbase.rsgroup.TestRSGroupsBasics.afterMethod(TestRSGroupsBasics.java:77) Caused by: org.apache.hadoop.hbase.ipc.RemoteWithExtrasException: org.apache.hadoop.hbase.constraint.ConstraintException: Target group is the same as source group: default at org.apache.hadoop.hbase.rsgroup.RSGroupAdminServer.moveServers(RSGroupAdminServer.java:169) at org.apache.hadoop.hbase.rsgroup.RSGroupAdminEndpoint.moveServers(RSGroupAdminEndpoint.java:216) at org.apache.hadoop.hbase.protobuf.generated.RSGroupAdminProtos$RSGroupAdminService.callMethod(RSGroupAdminProtos.java:13870) at org.apache.hadoop.hbase.master.MasterRpcServices.execMasterService(MasterRpcServices.java:711) at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java:63436) at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2380) at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:124) at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:297) at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:277) {code} I do not figure out the reason yet... Shall we revert this change from branch-1 as well as 1.5.1 ? Sorry for the inconvenience it brings > Improve RSGroupInfoManagerImpl#getDefaultServers() > -------------------------------------------------- > > Key: HBASE-22009 > URL: https://issues.apache.org/jira/browse/HBASE-22009 > Project: HBase > Issue Type: Improvement > Components: rsgroup > Reporter: Xiang Li > Assignee: Xiang Li > Priority: Minor > Fix For: 3.0.0, 2.2.0, 1.5.1, 2.2.1 > > Attachments: HBASE-22009.master.000.patch, > call_stack_getDefaultServers.png > > > {code:title=RSGroupInfoManagerImpl.java|borderStyle=solid} > private SortedSet<Address> getDefaultServers() throws IOException { > SortedSet<Address> defaultServers = Sets.newTreeSet(); > for (ServerName serverName : getOnlineRS()) { > Address server = Address.fromParts(serverName.getHostname(), > serverName.getPort()); > boolean found = false; > for (RSGroupInfo rsgi : listRSGroups()) { > if (!RSGroupInfo.DEFAULT_GROUP.equals(rsgi.getName()) && > rsgi.containsServer(server)) { > found = true; > break; > } > } > if (!found) { > defaultServers.add(server); > } > } > return defaultServers; > } > {code} > That is a logic of 2 nest loops. And for each server, listRSGroups() > allocates a new LinkedList and calls Map#values(), both of which are very > heavy operations. > Maybe the inner loop could be moved out, that is > # Build a list of servers of other groups than default group > # Iterate each online servers and check if it is in the list above. If it is > not, then it belongs to default group. -- This message was sent by Atlassian JIRA (v7.6.3#76005)