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

Add a 'log.file.age' configuration parameter to force rotation of log files after they've reached a certain age

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.7
    • Fix Version/s: 0.7.2, 0.8.0
    • Component/s: core
    • Labels:
      None

      Description

      The Kafka client has the ability to start consuming at an offset before or after a given point in time. The granularity of this offset is the log file as the Kafka servers do not keep track of arrival time of various messages.

      This means that the granularity of offsets relative to time depends on arrival rate of messages and thus of log file rotation. A topic with lots of messages will have its log files rotated very often (thus each spans a short time interval) whereas a topic with very few messages might not see its log files rotated for hours.

      In order to circumvent this granularity disparity, having a parameter that would force log file rotation after a certain delay (xxx ms) would allow for pretty much constant time granularity to be available at the cost of more file descriptor being used.

        Activity

        Hide
        junrao Jun Rao added a comment -

        This seems like a useful feature, in particular for kafka-236. What's the age granularity that you are looking for? We probably don't want to create too many files for a topic.

        Show
        junrao Jun Rao added a comment - This seems like a useful feature, in particular for kafka-236. What's the age granularity that you are looking for? We probably don't want to create too many files for a topic.
        Hide
        jkreps Jay Kreps added a comment -

        Didn't we do this?

        Show
        jkreps Jay Kreps added a comment - Didn't we do this?
        Hide
        swapnilghike Swapnil Ghike added a comment - - edited

        Yes, KAFKA-475 added a feature to 0.7 and 0.8 that rolls a new log segment based on the age of the old segment. So in essence, a new log segment is rolled when the old segment exceeds its max permissible size or max permissible age. These maximum size and age limits can be configured in KafkaConfig.

        Show
        swapnilghike Swapnil Ghike added a comment - - edited Yes, KAFKA-475 added a feature to 0.7 and 0.8 that rolls a new log segment based on the age of the old segment. So in essence, a new log segment is rolled when the old segment exceeds its max permissible size or max permissible age. These maximum size and age limits can be configured in KafkaConfig.

          People

          • Assignee:
            swapnilghike Swapnil Ghike
            Reporter:
            herberts Mathias Herberts
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development