Kafka
  1. Kafka
  2. KAFKA-1213

Adding fetcher needs to be avoided upon make-follower when replica manager is shutting down

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Not a Problem
    • Affects Version/s: None
    • Fix Version/s: 0.8.2.0
    • Component/s: None
    • Labels:
      None

      Description

      Today in ReplicaManager.makeFollowers, we check if isShuttingDown.get() is false before adding fetchers. However this check cannot avoid adding fetcher while at the same time shutting down replica manager since the isShuttingDown can be set to false after the check.

        Activity

        Guozhang Wang created issue -
        Neha Narkhede made changes -
        Field Original Value New Value
        Fix Version/s 0.8.2 [ 12326167 ]
        Fix Version/s 0.8.1 [ 12322960 ]
        Hide
        Jun Rao added a comment -

        Is this really an issue? During the controlled shutdown, we first set isShuttingDown to false before sending the shutdown request to the controller. We won't add new fetchers for the LeaderAndIsr requests received during the controlled shutdown.

        Show
        Jun Rao added a comment - Is this really an issue? During the controlled shutdown, we first set isShuttingDown to false before sending the shutdown request to the controller. We won't add new fetchers for the LeaderAndIsr requests received during the controlled shutdown.
        Hide
        Guozhang Wang added a comment -

        Jun, you are right. What I once observed is that the following time sequence can happen:

        1. Broker received normal LeaderAndIsr request from controller (not due to controlled shutdown)
        2. isShuttingDown.get returns false, so move on to adding fetchers.
        3. Broker decide to shutdown itself right after the check, set isShuttingDown to true.
        4. Hence broker can be adding fetchers while it is shutting down.

        But now I think this is actually fine. Will close the ticket.

        Show
        Guozhang Wang added a comment - Jun, you are right. What I once observed is that the following time sequence can happen: 1. Broker received normal LeaderAndIsr request from controller (not due to controlled shutdown) 2. isShuttingDown.get returns false, so move on to adding fetchers. 3. Broker decide to shutdown itself right after the check, set isShuttingDown to true. 4. Hence broker can be adding fetchers while it is shutting down. But now I think this is actually fine. Will close the ticket.
        Guozhang Wang made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Not a Problem [ 8 ]
        Guozhang Wang made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development