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

Writing to local files is done non-atomically

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 3.4.3
    • 3.4.4, 3.5.0
    • server
    • None
    • Reviewed

    Description

      Currently, the writeLongToFile() function opens the file for truncate, writes the new data, syncs, and then closes. If the process crashes after opening the file but before writing the new data, the file may be left empty, causing ZK to "forget" an earlier promise. Instead, it should use RandomAccessFile to avoid truncating.

      Attachments

        1. ZOOKEEPER-1427.patch
          21 kB
          Patrick D. Hunt
        2. ZOOKEEPER-1427_br34.patch
          21 kB
          Patrick D. Hunt
        3. ZOOKEEPER-1427.patch
          20 kB
          Patrick D. Hunt
        4. ZOOKEEPER-1427_br34.patch
          20 kB
          Patrick D. Hunt
        5. ZOOKEEPER-1427.patch
          20 kB
          Patrick D. Hunt
        6. ZOOKEEPER-1427_br34.patch
          20 kB
          Patrick D. Hunt

        Activity

          People

            phunt Patrick D. Hunt
            tlipcon Todd Lipcon
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: