Accumulo
  1. Accumulo
  2. ACCUMULO-1565

Clonetable with excluded properties causes a NullPointerException

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.1, 1.6.0
    • Component/s: None
    • Labels:
      None

      Description

      When cloning a table, there's an option to exclude certain properties from being copied over. When those excluded properties are processed in clone() in TableOperations, they are passed as options with a key and a null value. When passed through Thrift, the null value isn't expected because it uses the same process to set properties as well. Here's a stack trace.

      org.apache.accumulo.core.client.AccumuloException
      	at org.apache.accumulo.core.client.admin.TableOperationsImpl.doTableOperation(TableOperationsImpl.java:319)
      	at org.apache.accumulo.core.client.admin.TableOperationsImpl.doTableOperation(TableOperationsImpl.java:285)
      	at org.apache.accumulo.core.client.admin.TableOperationsImpl.clone(TableOperationsImpl.java:686)
      	at org.apache.accumulo.core.util.shell.commands.CloneTableCommand.execute(CloneTableCommand.java:68)
      	at org.apache.accumulo.core.util.shell.Shell.execCommand(Shell.java:617)
      	at org.apache.accumulo.core.util.shell.Shell.start(Shell.java:496)
      	at org.apache.accumulo.core.util.shell.Shell.main(Shell.java:418)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:616)
      	at org.apache.accumulo.start.Main$1.run(Main.java:105)
      	at java.lang.Thread.run(Thread.java:679)
      Caused by: java.lang.NullPointerException
      	at org.apache.thrift.protocol.TCompactProtocol.writeString(TCompactProtocol.java:325)
      	at org.apache.accumulo.core.master.thrift.MasterClientService$executeTableOperation_args$executeTableOperation_argsStandardScheme.write(MasterClientService.java:15606)
      	at org.apache.accumulo.core.master.thrift.MasterClientService$executeTableOperation_args$executeTableOperation_argsStandardScheme.write(MasterClientService.java:15467)
      	at org.apache.accumulo.core.master.thrift.MasterClientService$executeTableOperation_args.write(MasterClientService.java:15373)
      	at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:63)
      	at org.apache.accumulo.core.master.thrift.MasterClientService$Client.send_executeTableOperation(MasterClientService.java:493)
      	at org.apache.accumulo.core.master.thrift.MasterClientService$Client.executeTableOperation(MasterClientService.java:479)
      	at org.apache.accumulo.core.client.admin.TableOperationsImpl.executeTableOperation(TableOperationsImpl.java:241)
      	at org.apache.accumulo.core.client.admin.TableOperationsImpl.doTableOperation(TableOperationsImpl.java:294)
      	... 12 more
      

        Activity

        Hide
        ASF subversion and git services added a comment -

        Commit 0b85105a46de675fd207bd120562e8391dce8b5a in branch refs/heads/master from Christopher Tubbs
        [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=0b85105 ]

        ACCUMULO-1565 fixed deprecation warning in test

        Show
        ASF subversion and git services added a comment - Commit 0b85105a46de675fd207bd120562e8391dce8b5a in branch refs/heads/master from Christopher Tubbs [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=0b85105 ] ACCUMULO-1565 fixed deprecation warning in test
        Hide
        ASF subversion and git services added a comment -

        Commit 1c44069a35a1acfb2b806e1103c1992190c389eb in branch refs/heads/master from Keith Turner
        [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=1c44069 ]

        ACCUMULO-1565 fixed clone table NPE when excluding props

        Show
        ASF subversion and git services added a comment - Commit 1c44069a35a1acfb2b806e1103c1992190c389eb in branch refs/heads/master from Keith Turner [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=1c44069 ] ACCUMULO-1565 fixed clone table NPE when excluding props
        Hide
        ASF subversion and git services added a comment -

        Commit 14f8a80a84465b3d41724a7bf24544c6b0f67abe in branch refs/heads/master from [~keith_turner]
        [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=14f8a80 ]

        ACCUMULO-1565 converted clonet test to integration test.

        Show
        ASF subversion and git services added a comment - Commit 14f8a80a84465b3d41724a7bf24544c6b0f67abe in branch refs/heads/master from [~keith_turner] [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=14f8a80 ] ACCUMULO-1565 converted clonet test to integration test.
        Hide
        ASF subversion and git services added a comment -

        Commit 1c44069a35a1acfb2b806e1103c1992190c389eb in branch refs/heads/1.5.1-SNAPSHOT from Keith Turner
        [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=1c44069 ]

        ACCUMULO-1565 fixed clone table NPE when excluding props

        Show
        ASF subversion and git services added a comment - Commit 1c44069a35a1acfb2b806e1103c1992190c389eb in branch refs/heads/1.5.1-SNAPSHOT from Keith Turner [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=1c44069 ] ACCUMULO-1565 fixed clone table NPE when excluding props
        Hide
        Christopher Tubbs added a comment -

        I like the prefixing of the key idea. I was also thinking about this (with a "!" prefix, to denote "NOT") as a way of saying "don't inherit from the parent configuration" for per-table configurations (ACCUMULO-1619).

        Show
        Christopher Tubbs added a comment - I like the prefixing of the key idea. I was also thinking about this (with a "!" prefix, to denote "NOT") as a way of saying "don't inherit from the parent configuration" for per-table configurations ( ACCUMULO-1619 ).
        Hide
        Keith Turner added a comment -

        Sean Hickey, a test that reproduces the problem would be useful for preventing future regressions.

        Its possible that someone may want to set empty string for a prop and not exclude it. In addition to using empty string, I think prefixing the keys in the options map would be good. For example prefix all props to set with "SET:" and all props to exclude with "EX:". Then on the server side, the intent is clear based on the key prefix.

        Show
        Keith Turner added a comment - Sean Hickey , a test that reproduces the problem would be useful for preventing future regressions. Its possible that someone may want to set empty string for a prop and not exclude it. In addition to using empty string, I think prefixing the keys in the options map would be good. For example prefix all props to set with "SET:" and all props to exclude with "EX:". Then on the server side, the intent is clear based on the key prefix.
        Hide
        Eric Newton added a comment -

        Patched. Thanks! I changed "new String()" to "".

        Show
        Eric Newton added a comment - Patched. Thanks! I changed "new String()" to "".
        Hide
        ASF subversion and git services added a comment -

        Commit 3d06f475ebfcb4da9789ab30c22b9d7b2ab47ddf in branch refs/heads/master from Eric Newton
        [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=3d06f47 ]

        ACCUMULO-1565 applying Sean Hickey's patch

        Show
        ASF subversion and git services added a comment - Commit 3d06f475ebfcb4da9789ab30c22b9d7b2ab47ddf in branch refs/heads/master from Eric Newton [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=3d06f47 ] ACCUMULO-1565 applying Sean Hickey's patch
        Hide
        Sean Hickey added a comment -

        I needed this to work for Table Namespaces (ACCUMULO-802), so I thought I'd try to fix it. This patch only modifies CloneTable to use an empty string instead of null when excluding properties. I'm not sure if it would screw up anything (can there be empty-string property values?), but it was a small enough fix that I thought I'd post it.

        Show
        Sean Hickey added a comment - I needed this to work for Table Namespaces ( ACCUMULO-802 ), so I thought I'd try to fix it. This patch only modifies CloneTable to use an empty string instead of null when excluding properties. I'm not sure if it would screw up anything (can there be empty-string property values?), but it was a small enough fix that I thought I'd post it.

          People

          • Assignee:
            Sean Hickey
            Reporter:
            Sean Hickey
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development