-
Notifications
You must be signed in to change notification settings - Fork 455
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
Fixes balancing of metadata table #5195
Conversation
Have not tested these changes. Made similar changes in 4.0 and manually tested them. We probably need an IT that test balancing the metadata table if there is not one. In 4.0 this issue was preventing the metadata table from balancing across multiple tablet servers. |
@@ -1000,20 +1000,22 @@ private SortedMap<TServerInstance,TabletServerStatus> createTServerStatusView( | |||
final Map<String,TableInfo> newTableMap = | |||
new HashMap<>(dl == DataLevel.USER ? oldTableMap.size() : 1); | |||
if (dl == DataLevel.ROOT) { | |||
if (oldTableMap.containsKey(RootTable.NAME)) { | |||
newTableMap.put(RootTable.NAME, oldTableMap.get(RootTable.NAME)); | |||
if (oldTableMap.containsKey(RootTable.ID.canonical())) { |
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 make it a Map<TableId,TableInfo>
instead of Map<String,TableInfo>
?
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 make it a Map<TableId,TableInfo> instead of Map<String,TableInfo>?
The code is currently manipulating a Thrift object which can not use the TableId type. A larger refactor would be needed to make that change, could open in issue to look into that.
Working on adding an IT for metadata table balancing. |
Wrote a test and found some additional issues and made fixes to get the test to pass. Converted this PR to draft because I want to go review the changes I made to get the test to pass. |
After writing the new IT I saw the following problems, with the first being the initial reason I opened this PR.
For 1 the changes in 6eab50f fix this. For 2 and 3 the changes in 6de5ef9 fix these. For 2 created a new Migrations class that tracks migrations per data level so that when making balancing decisions it could always know if the previous levels had migrations. For 3 added a new method to the balancer SPI that conveys what tables need to be balanced. This new method support partitioning tables for balancing in different ways and allows balancers to delegate to other balancers with smaller partitions. May also allow different manager processes to parition tables for balancing in the future. Took this out of draft after the changes in 6de5ef9 The new IT added only test problem 1. For problems 2 and 3, I verified those by running the IT and looking at the manager logs. The test exercises the cause of problems 2 and 3 but will not fail if they occur. |
Adding a blocker label as this change is needed before finalizing the 2.1.4 release. |
Applied the BalanceIT test changes to current 2.1 and replicated the breakage.
Confirmed this is fixed by 6eab50f
This could be fixed in the current code by updating the balance method in TableLoadBalancer. accumulo/core/src/main/java/org/apache/accumulo/core/spi/balancer/TableLoadBalancer.java Lines 125 to 133 in aa7944b
It just needs to check the datalevel level of the tableId and just skipping that tableID if it does not match the current level.
I like the new migrations class but I'd like to understand how it fits into the overall balancing design. |
core/src/main/java/org/apache/accumulo/core/spi/balancer/GroupBalancer.java
Outdated
Show resolved
Hide resolved
Sometimes a balancer is expected to work with a smaller set of tables than the entire data level (like when the tablet balancer create a sub balancer). This is why I added the set of tables to balance as a map. This make it less mysterious, instead of using an arbitrary string to somehow determine which subset of tables to balance its given explicitly in a map. |
No description provided.