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

Empty path in Set crashes server and prevents restart

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.4.5
    • Fix Version/s: 3.4.7, 3.5.1, 3.6.0
    • Component/s: server
    • Labels:
      None

      Description

      See https://github.com/samuel/go-zookeeper/issues/62

      I've reproduced this on 3.4.5 with the code:
      c, _, _ := zk.Connect([]string

      {"127.0.0.1"}

      , time.Second)
      c.Set("", []byte{}, 0)

      This crashes a local zookeeper 3.4.5 server:
      2015-06-10 16:21:10,862 [myid:] - ERROR [SyncThread:0:SyncRequestProcessor@151] - Severe unrecoverable error, exiting
      java.lang.IllegalArgumentException: Invalid path
      at org.apache.zookeeper.common.PathTrie.findMaxPrefix(PathTrie.java:259)
      at org.apache.zookeeper.server.DataTree.getMaxPrefixWithQuota(DataTree.java:634)
      at org.apache.zookeeper.server.DataTree.setData(DataTree.java:616)
      at org.apache.zookeeper.server.DataTree.processTxn(DataTree.java:807)
      at org.apache.zookeeper.server.ZKDatabase.processTxn(ZKDatabase.java:329)
      at org.apache.zookeeper.server.ZooKeeperServer.processTxn(ZooKeeperServer.java:965)
      at org.apache.zookeeper.server.FinalRequestProcessor.processRequest(FinalRequestProcessor.java:116)
      at org.apache.zookeeper.server.SyncRequestProcessor.flush(SyncRequestProcessor.java:167)
      at org.apache.zookeeper.server.SyncRequestProcessor.run(SyncRequestProcessor.java:101)

      On restart the zookeeper server crashes out:
      2015-06-10 16:22:21,352 [myid:] - ERROR [main:ZooKeeperServerMain@54] - Invalid arguments, exiting abnormally
      java.lang.IllegalArgumentException: Invalid path
      at org.apache.zookeeper.common.PathTrie.findMaxPrefix(PathTrie.java:259)
      at org.apache.zookeeper.server.DataTree.getMaxPrefixWithQuota(DataTree.java:634)
      at org.apache.zookeeper.server.DataTree.setData(DataTree.java:616)
      at org.apache.zookeeper.server.DataTree.processTxn(DataTree.java:807)
      at org.apache.zookeeper.server.persistence.FileTxnSnapLog.processTransaction(FileTxnSnapLog.java:198)
      at org.apache.zookeeper.server.persistence.FileTxnSnapLog.restore(FileTxnSnapLog.java:151)
      at org.apache.zookeeper.server.ZKDatabase.loadDataBase(ZKDatabase.java:223)
      at org.apache.zookeeper.server.ZooKeeperServer.loadData(ZooKeeperServer.java:250)
      at org.apache.zookeeper.server.ZooKeeperServer.startdata(ZooKeeperServer.java:377)
      at org.apache.zookeeper.server.NIOServerCnxnFactory.startup(NIOServerCnxnFactory.java:122)
      at org.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:112)
      at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:86)
      at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:52)
      at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:116)
      at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)

        Attachments

        1. ZOOKEEPER-2213.patch
          8 kB
          Hongchao Deng
        2. ZOOKEEPER-2213.patch
          7 kB
          Hongchao Deng
        3. ZOOKEEPER-2213.patch
          8 kB
          Hongchao Deng
        4. ZOOKEEPER-2213.patch
          7 kB
          Hongchao Deng
        5. ZOOKEEPER-2213-branch34.patch
          8 kB
          Hongchao Deng

          Activity

            People

            • Assignee:
              hdeng Hongchao Deng
              Reporter:
              brianbrazil Brian Brazil
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: