Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-4535

HostRegexTableLoadBalancer fails with NullPointerException

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.2
    • Fix Version/s: 1.7.3, 1.8.1, 2.0.0
    • Component/s: None
    • Labels:
      None

      Description

      Ran into an issue when testing out the HostRegexTableLoadBalancer. It fails to start and throws a NullPointerException when trying to access the poolNameToRegexPattern. The root cause is the init function the load balancer overrides is the wrong one that the Master calls (wrong signature).

        Issue Links

          Activity

          Hide
          adamjshook Adam J Shook added a comment -

          Working on a GitHub PR now.

          Show
          adamjshook Adam J Shook added a comment - Working on a GitHub PR now.
          Hide
          dlmarion Dave Marion added a comment -

          Adam J Shook Do you know if the Master changed since I added this? I'm a little confused, as I tested this and it did work at one point.

          Show
          dlmarion Dave Marion added a comment - Adam J Shook Do you know if the Master changed since I added this? I'm a little confused, as I tested this and it did work at one point.
          Hide
          dlmarion Dave Marion added a comment -

          Also, is this the same as ACCUMULO-4196?

          Show
          dlmarion Dave Marion added a comment - Also, is this the same as ACCUMULO-4196 ?
          Hide
          adamjshook Adam J Shook added a comment - - edited

          I don't see any changes in the Blame around that part. Master [1] calls the TabletBalancer#init(ServerConfigurationFactory) which is not what the regex load balancer is overriding [2], and the TabletBalancer doesn't call the other init function [3].

          [1] https://github.com/apache/accumulo/blob/1.7/server/master/src/main/java/org/apache/accumulo/master/Master.java#L589
          [2] https://github.com/apache/accumulo/blob/1.7/server/base/src/main/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancer.java#L257
          [3] https://github.com/apache/accumulo/blob/1.7/server/base/src/main/java/org/apache/accumulo/server/master/balancer/TabletBalancer.java#L57

          I don't think it is the same as ACCUMULO-4196 – not enough details in that ticket to tell. It fails trying to get assignments:

          2016-12-15 13:35:55,349 [master.Master] ERROR: Error processing table state for store Root Table
          java.lang.NullPointerException
              at org.apache.accumulo.server.master.balancer.HostRegexTableLoadBalancer.getPoolNamesForHost(HostRegexTableLoadBalancer.java:142)
              at org.apache.accumulo.server.master.balancer.HostRegexTableLoadBalancer.splitCurrentByRegex(HostRegexTableLoadBalancer.java:108)
              at org.apache.accumulo.server.master.balancer.HostRegexTableLoadBalancer.getAssignments(HostRegexTableLoadBalancer.java:266)
              at org.apache.accumulo.master.TabletGroupWatcher.flushChanges(TabletGroupWatcher.java:745)
              at org.apache.accumulo.master.TabletGroupWatcher.run(TabletGroupWatcher.java:295)
          
          Show
          adamjshook Adam J Shook added a comment - - edited I don't see any changes in the Blame around that part. Master [1] calls the TabletBalancer#init(ServerConfigurationFactory) which is not what the regex load balancer is overriding [2] , and the TabletBalancer doesn't call the other init function [3] . [1] https://github.com/apache/accumulo/blob/1.7/server/master/src/main/java/org/apache/accumulo/master/Master.java#L589 [2] https://github.com/apache/accumulo/blob/1.7/server/base/src/main/java/org/apache/accumulo/server/master/balancer/HostRegexTableLoadBalancer.java#L257 [3] https://github.com/apache/accumulo/blob/1.7/server/base/src/main/java/org/apache/accumulo/server/master/balancer/TabletBalancer.java#L57 I don't think it is the same as ACCUMULO-4196 – not enough details in that ticket to tell. It fails trying to get assignments: 2016-12-15 13:35:55,349 [master.Master] ERROR: Error processing table state for store Root Table java.lang.NullPointerException at org.apache.accumulo.server.master.balancer.HostRegexTableLoadBalancer.getPoolNamesForHost(HostRegexTableLoadBalancer.java:142) at org.apache.accumulo.server.master.balancer.HostRegexTableLoadBalancer.splitCurrentByRegex(HostRegexTableLoadBalancer.java:108) at org.apache.accumulo.server.master.balancer.HostRegexTableLoadBalancer.getAssignments(HostRegexTableLoadBalancer.java:266) at org.apache.accumulo.master.TabletGroupWatcher.flushChanges(TabletGroupWatcher.java:745) at org.apache.accumulo.master.TabletGroupWatcher.run(TabletGroupWatcher.java:295)
          Hide
          adamjshook Adam J Shook added a comment - - edited

          Wouldn't it be best to remove TabletBalancer#init(ServerConfiguration) entirely? I find no other usages of this function outside of the HostRegexTableLoadBalancer tests and in the ChaoticLoadBalancer which just throws a not implemented exception.

          edit: edit: Nevermind the nevermind, this could be done... Though it would break custom load balancers that are using this function instead of the other one.

          Show
          adamjshook Adam J Shook added a comment - - edited Wouldn't it be best to remove TabletBalancer#init(ServerConfiguration) entirely? I find no other usages of this function outside of the HostRegexTableLoadBalancer tests and in the ChaoticLoadBalancer which just throws a not implemented exception. edit: edit: Nevermind the nevermind, this could be done... Though it would break custom load balancers that are using this function instead of the other one.
          Hide
          elserj Josh Elser added a comment -

          Though it would break custom load balancers that are using this function instead of the other one

          This is one of those really hard decisions to make. Personally, I fall on the side of: "if we can avoid breaking people, please do". But, we are technically under no obligation to maintain compatibility here. I also find it absurd that we're presenting extension points that aren't covered by any compatibility guarantees...

          Show
          elserj Josh Elser added a comment - Though it would break custom load balancers that are using this function instead of the other one This is one of those really hard decisions to make. Personally, I fall on the side of: "if we can avoid breaking people, please do". But, we are technically under no obligation to maintain compatibility here. I also find it absurd that we're presenting extension points that aren't covered by any compatibility guarantees...
          Hide
          elserj Josh Elser added a comment -

          Thanks for the fix, Adam!

          Show
          elserj Josh Elser added a comment - Thanks for the fix, Adam!

            People

            • Assignee:
              adamjshook Adam J Shook
              Reporter:
              adamjshook Adam J Shook
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h 50m
                2h 50m

                  Development