Skip to content

Commit 2b25fca

Browse files
authored
HBASE-24755 [LOG][RSGroup]Error message is confusing while adding a offline RS to rsgroup (#2847) (#2846)
Signed-off-by: Viraj Jasani <[email protected]> Signed-off-by: Wellington Chevreuil <[email protected]>
1 parent cec9f18 commit 2b25fca

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ private void checkServersAndTables(Set<Address> servers, Set<TableName> tables,
159159
Address firstServer = servers.iterator().next();
160160
RSGroupInfo tmpSrcGrp = rsGroupInfoManager.getRSGroupOfServer(firstServer);
161161
if (tmpSrcGrp == null) {
162-
// Be careful. This exception message is tested for in TestRSGroupsBase...
163-
throw new ConstraintException("Source RSGroup for server " + firstServer
164-
+ " does not exist.");
162+
// Be careful. This exception message is tested for in TestRSGroupsAdmin2...
163+
throw new ConstraintException("Server " + firstServer
164+
+ " is either offline or it does not exist.");
165165
}
166166
RSGroupInfo srcGrp = new RSGroupInfo(tmpSrcGrp);
167167

@@ -397,9 +397,9 @@ public void moveServers(Set<Address> servers, String targetGroupName) throws IOE
397397
Address firstServer = servers.iterator().next();
398398
RSGroupInfo srcGrp = rsGroupInfoManager.getRSGroupOfServer(firstServer);
399399
if (srcGrp == null) {
400-
// Be careful. This exception message is tested for in TestRSGroupsBase...
401-
throw new ConstraintException("Source RSGroup for server " + firstServer
402-
+ " does not exist.");
400+
// Be careful. This exception message is tested for in TestRSGroupsAdmin2...
401+
throw new ConstraintException("Server " + firstServer
402+
+ " is either offline or it does not exist.");
403403
}
404404
// Only move online servers (when moving from 'default') or servers from other
405405
// groups. This prevents bogus servers from entering groups

hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsAdmin2.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public void testMoveServers() throws Exception {
185185
rsGroupAdmin.moveServers(Sets.newHashSet(Address.fromString("foo:9999")), "foo");
186186
fail("Bogus servers shouldn't have been successfully moved.");
187187
} catch (IOException ex) {
188-
String exp = "Source RSGroup for server foo:9999 does not exist.";
188+
String exp = "Server foo:9999 is either offline or it does not exist.";
189189
String msg = "Expected '" + exp + "' in exception message: ";
190190
assertTrue(msg + " " + ex.getMessage(), ex.getMessage().contains(exp));
191191
}
@@ -333,7 +333,7 @@ public boolean evaluate() throws Exception {
333333
Sets.newHashSet(tableName), newGroup.getName());
334334
fail("Bogus servers shouldn't have been successfully moved.");
335335
} catch (IOException ex) {
336-
String exp = "Source RSGroup for server foo:9999 does not exist.";
336+
String exp = "Server foo:9999 is either offline or it does not exist.";
337337
String msg = "Expected '" + exp + "' in exception message: ";
338338
assertTrue(msg + " " + ex.getMessage(), ex.getMessage().contains(exp));
339339
}

0 commit comments

Comments
 (0)