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

Server fails to start if there is a zero-length TxnLog file present in the log directory

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 3.4.6
    • None
    • server
    • None
    • Windows

    Description

      If there is an empty TxnLog file in the log file folder, ZooKeeper server fails to start. This is the exception it logs:

      2015-11-02 07:41:10.479 -0600 (,,,) main : ERROR org.apache.zookeeper.server.ZooKeeperServerMain - Unexpected exception, exiting abnormally

      java.io.EOFException

      at java.io.DataInputStream.readInt(DataInputStream.java:392)

      at org.apache.jute.BinaryInputArchive.readInt(BinaryInputArchive.java:63)

      at org.apache.zookeeper.server.persistence.FileHeader.deserialize(FileHeader.java:64)

      at org.apache.zookeeper.server.persistence.FileTxnLog$FileTxnIterator.inStreamCreated(FileTxnLog.java:576)

      at org.apache.zookeeper.server.persistence.FileTxnLog$FileTxnIterator.createInputArchive(FileTxnLog.java:595)

      at org.apache.zookeeper.server.persistence.FileTxnLog$FileTxnIterator.goToNextLog(FileTxnLog.java:561)

      at org.apache.zookeeper.server.persistence.FileTxnLog$FileTxnIterator.next(FileTxnLog.java:643)

      at org.apache.zookeeper.server.persistence.FileTxnSnapLog.restore(FileTxnSnapLog.java:158)

      at org.apache.zookeeper.server.ZKDatabase.loadDataBase(ZKDatabase.java:223)

      at org.apache.zookeeper.server.ZooKeeperServer.loadData(ZooKeeperServer.java:272)

      at org.apache.zookeeper.server.ZooKeeperServer.startdata(ZooKeeperServer.java:399)

      at org.apache.zookeeper.server.NIOServerCnxnFactory.startup(NIOServerCnxnFactory.java:122)

      at org.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:113)

      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)

      Zero-length log file can be created if FileTxnLog.append() crashes after it creates FileOutputStream but before it serializes and flushes the header.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dryabkov Dmitry Ryabkov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: