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

Log recovery can fail if topic names contain one of the index suffixes

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.10.2.0, 0.10.2.1
    • Fix Version/s: 0.11.0.0
    • Component/s: None
    • Labels:
      None

      Description

      Our log recovery logic fails in 0.10.2 and prior releases if the topic name contains "index" or "timeindex." The issue is this snippet:

      val logFile =
                if (filename.endsWith(TimeIndexFileSuffix))
                  new File(file.getAbsolutePath.replace(TimeIndexFileSuffix, LogFileSuffix))
                else
                  new File(file.getAbsolutePath.replace(IndexFileSuffix, LogFileSuffix))
      
              if(!logFile.exists) {
                warn("Found an orphaned index file, %s, with no corresponding log file.".format(file.getAbsolutePath))
                file.delete()
              }
      

      The replace is a global replace, so the substituted filename is incorrect if the topic contains the index suffix.

      Note this is already fixed in trunk and 0.11.0.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hachikuji Jason Gustafson
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: