Kafka
  1. Kafka
  2. KAFKA-292

broker deletes all file segments when cleaning up an empty log segment

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.7.1
    • Component/s: core
    • Labels:
      None

      Description

      Suppose that a log has only one log segment left and it's empty. If that segment expires and is deleted, we roll out a new segment of the same name. However, the deletion happens after the log is rolled. This will make the log directory empty, which should never happen.

      1. kafka-292.patch
        2 kB
        Jun Rao
      2. kafka-292_v2.patch
        2 kB
        Jun Rao

        Activity

        Hide
        Jun Rao added a comment -

        Committed to trunk.

        Show
        Jun Rao added a comment - Committed to trunk.
        Hide
        Neha Narkhede added a comment -

        +1 on v2. Good catch !

        Show
        Neha Narkhede added a comment - +1 on v2. Good catch !
        Hide
        Jun Rao added a comment -

        Attach patch v2. There is already a unit test for this. Just need to add the necessary checking.

        Show
        Jun Rao added a comment - Attach patch v2. There is already a unit test for this. Just need to add the necessary checking.
        Hide
        Neha Narkhede added a comment -

        It will be very useful to have a unit test for this. Will make it easier to catch this in the future.

        Show
        Neha Narkhede added a comment - It will be very useful to have a unit test for this. Will make it easier to catch this in the future.
        Hide
        Jun Rao added a comment -

        patch attached.

        Show
        Jun Rao added a comment - patch attached.

          People

          • Assignee:
            Jun Rao
            Reporter:
            Jun Rao
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development