Kafka
  1. Kafka
  2. KAFKA-1152

ReplicaManager's handling of the leaderAndIsrRequest should gracefully handle leader == -1

    Details

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

      Description

      If a partition is created with replication factor 1, then the controller can set the partition's leader to -1 in leaderAndIsrRequest when the only replica of the partition is being bounced.

      The handling of this request with a leader == -1 throws an exception on the ReplicaManager which prevents the addition of fetchers for the remaining partitions in the leaderAndIsrRequest.

      After the replica is bounced, the replica first receives a leaderAndIsrRequest with leader == -1, then it receives another leaderAndIsrRequest with the correct leader (which is the replica itself) due to OfflinePartition to OnlinePartition state change.

      In handling the first request, ReplicaManager should ignore the partition for which the request has leader == -1, and continue addition of fetchers for the remaining partitions. The next leaderAndIsrRequest will take care of setting the correct leader for that partition.

      1. incremental.patch
        2 kB
        Swapnil Ghike
      2. KAFKA-1152_2013-11-28_22:40:55.patch
        3 kB
        Swapnil Ghike
      3. KAFKA-1152_2013-11-28_10:19:05.patch
        3 kB
        Swapnil Ghike
      4. KAFKA-1152.patch
        5 kB
        Swapnil Ghike

        Activity

        Hide
        Swapnil Ghike added a comment -

        Created reviewboard https://reviews.apache.org/r/15901/
        against branch origin/trunk

        Show
        Swapnil Ghike added a comment - Created reviewboard https://reviews.apache.org/r/15901/ against branch origin/trunk
        Hide
        Swapnil Ghike added a comment -

        Updated reviewboard https://reviews.apache.org/r/15901/
        against branch origin/trunk

        Show
        Swapnil Ghike added a comment - Updated reviewboard https://reviews.apache.org/r/15901/ against branch origin/trunk
        Hide
        Swapnil Ghike added a comment -

        Created reviewboard https://reviews.apache.org/r/15915/
        against branch origin/trunk

        Show
        Swapnil Ghike added a comment - Created reviewboard https://reviews.apache.org/r/15915/ against branch origin/trunk
        Hide
        Swapnil Ghike added a comment -

        Updated reviewboard https://reviews.apache.org/r/15901/
        against branch origin/trunk

        Show
        Swapnil Ghike added a comment - Updated reviewboard https://reviews.apache.org/r/15901/ against branch origin/trunk
        Hide
        Jun Rao added a comment -

        Thanks for the patch. +1 and committed to trunk.

        Show
        Jun Rao added a comment - Thanks for the patch. +1 and committed to trunk.
        Hide
        Swapnil Ghike added a comment -

        Attached a patch to fix logging statement.

        Show
        Swapnil Ghike added a comment - Attached a patch to fix logging statement.
        Hide
        Jun Rao added a comment -

        Thanks for the incremental patch. +1 and committed to trunk.

        Show
        Jun Rao added a comment - Thanks for the incremental patch. +1 and committed to trunk.

          People

          • Assignee:
            Swapnil Ghike
            Reporter:
            Swapnil Ghike
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development