Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-1220

./zkCli.sh 'create' command is throwing ArrayIndexOutOfBoundsException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.3.3
    • 3.5.0
    • scripts
    • None
    • Reviewed

    Description

      Few problems while executing create command,

      If we will give command like

      1)[zk: localhost:2181(CONNECTED) 0] create -s -e /node1

             Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4
      	at org.apache.zookeeper.ZooKeeperMain.processZKCmd(ZooKeeperMain.java:692)
      	at org.apache.zookeeper.ZooKeeperMain.processCmd(ZooKeeperMain.java:593)
      	at org.apache.zookeeper.ZooKeeperMain.executeLine(ZooKeeperMain.java:365)
      	at org.apache.zookeeper.ZooKeeperMain.run(ZooKeeperMain.java:323)
      	at org.apache.zookeeper.ZooKeeperMain.main(ZooKeeperMain.java:282)
      

      but actually it should create emphemeral sequential node.

      2)[zk: localhost:2181(CONNECTED) 0] create -s -e

          Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3
      

      here it should print the list of commands that is the default behaviour of zkCli for invalid/incomplete commands.

      3)[zk: localhost:2181(CONNECTED) 3] create -s -e "data"

           Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4
      

      here command is wrong so it should print list of commnads. .

      4)[zk: localhost:2181(CONNECTED) 0] create /node1
      zkCli is treating it as a invalid command.because for args.length check (3)is their but behaviour is
      if user haven't given any of the option it should create persistent node.

      	  if (cmd.equals("create") && args.length >= 3) {
                  int first = 0;
                  CreateMode flags = CreateMode.PERSISTENT;
      

      Attachments

        1. ZOOKEEPER-1220.patch
          5 kB
          kavita sharma
        2. ZOOKEEPER-1220.1.patch
          9 kB
          kavita sharma
        3. ZOOKEEPER-1220.patch
          11 kB
          Thomas Koch
        4. ZOOKEEPER-1220.2.patch
          0.8 kB
          kavita sharma

        Activity

          People

            kavita sharma kavita sharma
            kavita sharma kavita sharma
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: