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

Writing to local files is done non-atomically

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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_br34.patch
          21 kB
          Patrick D. Hunt
        2. ZOOKEEPER-1427_br34.patch
          20 kB
          Patrick D. Hunt
        3. ZOOKEEPER-1427_br34.patch
          20 kB
          Patrick D. Hunt
        4. ZOOKEEPER-1427.patch
          21 kB
          Patrick D. Hunt
        5. ZOOKEEPER-1427.patch
          20 kB
          Patrick D. Hunt
        6. ZOOKEEPER-1427.patch
          20 kB
          Patrick D. Hunt

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            phunt Patrick D. Hunt Assign to me
            tlipcon Todd Lipcon
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment