-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HBASE-22695 Store the rsgroup of a table in table configuration #426
Conversation
Still some bugs in the balancer and can not pass TestRSGroupsAdmin2. Will update the patch soon. Create a PR first so others can see the approach on how to store rsgroup of a table in table configuration. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
@@ -76,7 +82,6 @@ public RSGroupInfo getRSGroupInfo(String groupName) throws IOException { | |||
} | |||
} | |||
|
|||
@Override | |||
public RSGroupInfo getRSGroupInfoOfTable(TableName tableName) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method can be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will reference this method in hbase shell so do not want to change it in this patch...
Let's do it in another issue. And in general, if we do not want to completely remove the shell command, we'd better keep this method for a least a whole major version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can change the impl of "get_table_rsgroup" cmd? Then there will no internal usage for this.
hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java
Outdated
Show resolved
Hide resolved
if (!desc.getTableName().isSystemTable() && !rsgroupHasServersOnline(desc)) { | ||
throw new HBaseIOException("No online servers in the rsgroup, which table " + | ||
desc.getTableName().getNameAsString() + " belongs to"); | ||
throw new HBaseIOException("No online servers in the rsgroup for " + desc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why skip check for system table?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just keep the old behavior. And in general, I do not think we need to check for online servers here. Region servers can die at any time and cause the rs group to have no servers in group, so users may get random behaviors and confused...
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
* @deprecated Since 3.0.0, will be removed in 4.0.0. The rsgroup information will be stored in | ||
* the configuration of a table so this will be removed. | ||
*/ | ||
@Deprecated | ||
public boolean containsTable(TableName table) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a key method when checking if regions should be moved. Must remove it and implement a new method in moveServerRegionsFromGroup()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I reimplemented the related methods. Please see RSGroupAdminServer.moveRegionsBetweenGroups.
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
8933d66
to
69850cb
Compare
NamespaceDescriptor nd = clusterSchema.getNamespace(tableName.getNamespaceAsString()); | ||
String groupNameOfNs = nd.getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP); | ||
if (groupNameOfNs == null) { | ||
return Optional.empty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not return RSGroupInfo.DEFAULT_GROUP instead of empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty here can tell the upper layer that there is no rs group setting for this table. If we return default rs group here, the upper layer can not know if there is no rs group setting, or user set the rs group to default explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought tables without settings of rs group are in DEFAULT group. And for your concerns, I think the method name is confusing, no matter whether a table is set to default, its group info is default, but table description of rs group can be empty. Maybe we can distinguish by table description.
It doesn't matter, it's a very little problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For users, no config means in default rs group, no problem. But this is an internal method, so I think exposing more states is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, got it.
💔 -1 overall
This message was automatically generated. |
int serverCount = rsGroupInfo.getServers().size(); | ||
if (serverCount > 0) { | ||
throw new ConstraintException("RSGroup " + name + " has " + serverCount + | ||
" servers; you must remove these servers from the RSGroup before" + | ||
"the RSGroup can be removed."); | ||
" servers; you must remove these servers from the RSGroup before" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a space after "RSGroup before"
// check the set of servers | ||
checkForDeadOrOnlineServers(servers); | ||
rsGroupInfoManager.removeServers(servers); | ||
LOG.info("Remove decommissioned servers {} from RSGroup done", servers); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why "decommissioned" servers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't changed the logic here, just formatting. I guess the removeServers method is to completely remove servers from any rs groups, that;s why they use the word 'decommissioned'.
💔 -1 overall
This message was automatically generated. |
if (optGroup.isPresent()) { | ||
builder.setRSGroupInfo(ProtobufUtil.toProtoGroupInfo(fillTables(optGroup.get()))); | ||
} else { | ||
if (master.getTableStateManager().isTablePresent(tableName)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't check table present for above case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only if the table is present, we can have a rs group config for the table.
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
Signed-off-by: Guanghao Zhang <zghao@apache.org>
…he#426) Signed-off-by: Guanghao Zhang <zghao@apache.org>
…he#426) Signed-off-by: Guanghao Zhang <zghao@apache.org>
No description provided.