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

NullPointerException while truncating at high watermark can crash replica fetcher thread

Agile BoardAttach filesAttach ScreenshotVotersStop watchingWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 2.2.0, 2.1.1
    • 2.2.0, 2.1.2
    • core
    • None

    Description

      An NPE can occur when the replica fetcher manager simultaneously calls `removeFetcherForPartitions`, removing the corresponding partitionStates, while a replica fetcher thread attempts to truncate the same partition(s) in `truncateToHighWatermark`.

      Stack trace for failure case:

      java.lang.NullPointerException
      at kafka.server.AbstractFetcherThread.$anonfun$truncateToHighWatermark$2(AbstractFetcherThread.scala:213)
      at scala.collection.mutable.HashSet.foreach(HashSet.scala:79)
      at kafka.server.AbstractFetcherThread.$anonfun$truncateToHighWatermark$1(AbstractFetcherThread.scala:211)
      at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
      at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:251)
      at kafka.server.AbstractFetcherThread.truncateToHighWatermark(AbstractFetcherThread.scala:207)
      at kafka.server.AbstractFetcherThread.maybeTruncate(AbstractFetcherThread.scala:173)
      at kafka.server.AbstractFetcherThread.doWork(AbstractFetcherThread.scala:112)
      at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:82)

       

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            colinhicks Colin Hicks
            colinhicks Colin Hicks
            Votes:
            0 Vote for this issue
            Watchers:
            3 Stop watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment