-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-22642 Make move operations of RSGroup idempotent #387
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -177,10 +177,7 @@ private void checkServersAndTables(Set<Address> servers, Set<TableName> tables, | |
| + " does not exist."); | ||
| } | ||
| RSGroupInfo srcGrp = new RSGroupInfo(tmpSrcGrp); | ||
| if (srcGrp.getName().equals(targetGroupName)) { | ||
| throw new ConstraintException("Target RSGroup " + targetGroupName + | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If a table have 10 regions, and only 1 region is on the wrong rsgroup. The move will only move the wrong region and don't move the other 9 regions?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. It will judge which regions should be moved. Regions in correct group will not be moved in the origin logic. |
||
| " is same as source " + srcGrp.getName() + " RSGroup."); | ||
| } | ||
|
|
||
| // Only move online servers | ||
| checkOnlineServersOnly(servers); | ||
|
|
||
|
|
@@ -351,10 +348,6 @@ public void moveServers(Set<Address> servers, String targetGroupName) throws IOE | |
| throw new ConstraintException("Source RSGroup for server " + firstServer | ||
| + " does not exist."); | ||
| } | ||
| if (srcGrp.getName().equals(targetGroupName)) { | ||
| throw new ConstraintException("Target RSGroup " + targetGroupName + | ||
| " is same as source " + srcGrp + " RSGroup."); | ||
| } | ||
| // Only move online servers (when moving from 'default') or servers from other | ||
| // groups. This prevents bogus servers from entering groups | ||
| if (RSGroupInfo.DEFAULT_GROUP.equals(srcGrp.getName())) { | ||
|
|
@@ -406,16 +399,6 @@ public void moveTables(Set<TableName> tables, String targetGroup) throws IOExcep | |
| throw new ConstraintException("Target RSGroup must have at least one server."); | ||
| } | ||
| } | ||
|
|
||
| for (TableName table : tables) { | ||
| String srcGroup = rsGroupInfoManager.getRSGroupOfTable(table); | ||
| if(srcGroup != null && srcGroup.equals(targetGroup)) { | ||
| throw new ConstraintException( | ||
| "Source RSGroup " + srcGroup + " is same as target " + targetGroup + | ||
| " RSGroup for table " + table); | ||
| } | ||
| LOG.info("Moving table {} to RSGroup {}", table.getNameAsString(), targetGroup); | ||
| } | ||
| rsGroupInfoManager.moveTables(tables, targetGroup); | ||
|
|
||
| // targetGroup is null when a table is being deleted. In this case no further | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.