Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-4067

improve the handling of IOException in log.close()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.10.0.1
    • None
    • None
    • None

    Description

      While reviewing KIP-33, I noticed that there are a few places that we can improve in closing a log.

      1. In FileMessageSet.close(): We should probably call flush after trim since the later could change the size of the file channel.

      2. AbstractIndex.close(): We should call flush at the end.

      3. In Log.close(), if we hit an IOException, currently we just log it and proceed with a clean shutdown. However, an IOException could leave the log or indexes (e.g., when calling flush()) in a corrupted state. So, we probably should halt the jvm in this case to force log recovery on restart.

      Attachments

        Activity

          People

            Unassigned Unassigned
            junrao Jun Rao
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: