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

CRC check failed when preAllocSize smaller than node data

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.5.3, 3.4.11, 3.6.0
    • Fix Version/s: 3.5.4, 3.6.0, 3.4.12
    • Component/s: None
    • Labels:

      Description

      Unexpected exception, exiting abnormally
      java.io.IOException: CRC check failed
      org.apache.zookeeper.server.persistence.FileTxnLog$FileTxnIterator.next(FileTxnLog.java:612)
      org.apache.zookeeper.server.persistence.FileTxnSnapLog.restore(FileTxnSnapLog.java:157)
      org.apache.zookeeper.server.ZKDatabase.loadDataBase(ZKDatabase.java:223)
      org.apache.zookeeper.server.ZooKeeperServer.loadData(ZooKeeperServer.java:272)
      org.apache.zookeeper.server.ZooKeeperServer.startdata(ZooKeeperServer.java:399)

      To reproduce, set the preAllocSize to 8MB, the jute.maxbuffer to 20MB and try saving a 15MB node several times.
      In my case the erroneous CRC appears after the second save. I use the LogFormatter class to detect it.
      I suspect that the CRC error happens when the new transaction log is created, the code probably expects to have enough room to save the transaction when creating a new file, but it's too small.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                abrahamfine Abraham Fine
                Reporter:
                benjamin.jaton Benjamin Jaton
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: