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

NPE will be thrown while deleting topic and fetch from follower concurrently

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.5.0
    • 3.6.0
    • None
    • None

    Description

      When deleting topics, we'll first clear all the remoteReplicaMap when stopPartitions here. But this time, there might be fetch request coming from follower, and try to check if the replica is eligible to be added into ISR here. At this moment, NPE will be thrown. Although it's fine since this topic is already deleted, it'd be better to avoid it happen.

       

       

      java.lang.NullPointerException: Cannot invoke "kafka.cluster.Replica.stateSnapshot()" because the return value of "kafka.utils.Pool.get(Object)" is null	at kafka.cluster.Partition.isReplicaIsrEligible(Partition.scala:992) ~[kafka_2.13-3.5.0.jar:?]	at kafka.cluster.Partition.canAddReplicaToIsr(Partition.scala:974) ~[kafka_2.13-3.5.0.jar:?]	at kafka.cluster.Partition.maybeExpandIsr(Partition.scala:947) ~[kafka_2.13-3.5.0.jar:?]	at kafka.cluster.Partition.updateFollowerFetchState(Partition.scala:866) ~[kafka_2.13-3.5.0.jar:?]	at kafka.cluster.Partition.fetchRecords(Partition.scala:1361) ~[kafka_2.13-3.5.0.jar:?]	at kafka.server.ReplicaManager.read$1(ReplicaManager.scala:1164) ~[kafka_2.13-3.5.0.jar:?]	at kafka.server.ReplicaManager.$anonfun$readFromLocalLog$7(ReplicaManager.scala:1235) ~[kafka_2.13-3.5.0.jar:?]	at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:575) ~[scala-library-2.13.10.jar:?]	at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:573) ~[scala-library-2.13.10.jar:?]	at scala.collection.AbstractIterable.foreach(Iterable.scala:933) ~[scala-library-2.13.10.jar:?]	at kafka.server.ReplicaManager.readFromLocalLog(ReplicaManager.scala:1234) ~[kafka_2.13-3.5.0.jar:?]	at kafka.server.ReplicaManager.fetchMessages(ReplicaManager.scala:1044) ~[kafka_2.13-3.5.0.jar:?]	at kafka.server.KafkaApis.handleFetchRequest(KafkaApis.scala:994) ~[kafka_2.13-3.5.0.jar:?]	at kafka.server.KafkaApis.handle(KafkaApis.scala:181) ~[kafka_2.13-3.5.0.jar:?]	at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:76) ~[kafka_2.13-3.5.0.jar:?]	at java.lang.Thread.run(Thread.java:1623) [?:?] 

      Attachments

        Issue Links

          Activity

            People

              sagarrao Sagar Rao
              showuon Luke Chen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: