Kafka
  1. Kafka
  2. KAFKA-1009

DumpLogSegments tool should return error on non-existing files

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.8.0
    • Fix Version/s: 0.8.1
    • Component/s: log
    • Labels:
      None

      Description

      If we run the tool on an non-existing file, we get the following

      bin/kafka-run-class.sh kafka.tools.DumpLogSegments --files 00.log
      Dumping 00.log
      Starting offset: 0

      The tool should return an error message instead.

      1. KAFKA-1009.v2.patch
        2 kB
        Guozhang Wang
      2. KAFKA-1009.v1.patch
        2 kB
        Guozhang Wang

        Activity

        Neha Narkhede made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Neha Narkhede added a comment -

        Committed to trunk

        Show
        Neha Narkhede added a comment - Committed to trunk
        Neha Narkhede made changes -
        Component/s log [ 12320320 ]
        Component/s core [ 12315217 ]
        Hide
        Neha Narkhede added a comment -

        1. I see what you are saying.

        The patch looks good. Thanks for fixing the bug. +1

        Show
        Neha Narkhede added a comment - 1. I see what you are saying. The patch looks good. Thanks for fixing the bug. +1
        Guozhang Wang made changes -
        Attachment KAFKA-1009.v2.patch [ 12598777 ]
        Hide
        Guozhang Wang added a comment -

        Thanks for the comments Neha.

        1. We do set default mutable to true, what I said is that we add another function that do accept the mutable parameter and pass it instead of always using the default.

        2. Rebased on trunk for v2.

        Show
        Guozhang Wang added a comment - Thanks for the comments Neha. 1. We do set default mutable to true, what I said is that we add another function that do accept the mutable parameter and pass it instead of always using the default. 2. Rebased on trunk for v2.
        Hide
        Neha Narkhede added a comment -

        Thanks for the patch, Guozhang. Two comments -

        1. We should default mutable=true in FileMessageSet
        2. I think we should take this patch on trunk. Could you provide another patch for trunk since this one fails?

        Show
        Neha Narkhede added a comment - Thanks for the patch, Guozhang. Two comments - 1. We should default mutable=true in FileMessageSet 2. I think we should take this patch on trunk. Could you provide another patch for trunk since this one fails?
        Guozhang Wang made changes -
        Attachment KAFKA-1009.v1.patch [ 12598114 ]
        Guozhang Wang made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Guozhang Wang added a comment -

        This is due to the fact that in dumpLog, it create a FileMessageSet(file) for the filename, which use "rw" in creating the RandomAccessFile. When under "rw" mode if the file does not exist it will create one.

        Proposed fix: instead of call FileMessageSet(file), call a new function FileMessageSet(file, mutable), and set mutable to false to specify it is read-only.

        Show
        Guozhang Wang added a comment - This is due to the fact that in dumpLog, it create a FileMessageSet(file) for the filename, which use "rw" in creating the RandomAccessFile. When under "rw" mode if the file does not exist it will create one. Proposed fix: instead of call FileMessageSet(file), call a new function FileMessageSet(file, mutable), and set mutable to false to specify it is read-only.
        Guozhang Wang made changes -
        Field Original Value New Value
        Assignee Guozhang Wang [ guozhang ]
        Jun Rao created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development