Uploaded image for project: 'Flume'
  1. Flume
  2. FLUME-2950

ReliableSpoolingFileEventReader.rollCurrentFile is broken

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.7.0
    • 1.7.0
    • None
    • None

    Description

      FLUME-2939 introduced Java 7 API (nio.file) to ReliableSpoolingFileEventReader. However, the committed patch breaks rollCurrentFile on Windows machines.
      File rename might be not atomic, in such cases, and under the assumption that the rolled file and the current file store the same data, Flume only logs a warning and does not assume that the user broke the contract that the spooling directory source demands.
      In order to determine whether the files store the same data, we used the com.google.common.io.Files.equal method. However, FLUME-2939 uses java.nio.file.Files.isSameFile which has different semantics.
      Consequently, this relaxation does not hold anymore. In addition, org.apache.flume.client.avro.TestSpoolingFileLineReader.testDestinationExistsAndSameFileWindows fails.

      I attach a patch that brings back the old check for Files.equal.

      Attachments

        1. FLUME-2950-0.patch
          1.0 kB
          Lior Zeno

        Activity

          People

            liorze Lior Zeno
            liorze Lior Zeno
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: