You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by Swapnil Ghike <sg...@linkedin.com> on 2013/11/28 07:31:43 UTC

Review Request 15901: ReplicaManager's handling of the leaderAndIsrRequest should gracefully handle leader == -1

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/15901/
-----------------------------------------------------------

Review request for kafka.


Bugs: KAFKA-1152
    https://issues.apache.org/jira/browse/KAFKA-1152


Repository: kafka


Description
-------

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


Diffs
-----

  core/src/main/scala/kafka/server/ReplicaManager.scala 161f58134f20f9335dbd2bee6ac3f71897cbef7c 

Diff: https://reviews.apache.org/r/15901/diff/


Testing
-------

Builds


Thanks,

Swapnil Ghike


Re: Review Request 15901: ReplicaManager's handling of the leaderAndIsrRequest should gracefully handle leader == -1

Posted by Jun Rao <ju...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/15901/#review29535
-----------------------------------------------------------



core/src/main/scala/kafka/server/ReplicaManager.scala
<https://reviews.apache.org/r/15901/#comment56886>

    We probably should guard the more general case, i.e, if can't find the leader broker, we will just skip this partition (rather than just handling the leader = -1 case).
    
    It's probably also useful to log the partitions that are skipped.
    


- Jun Rao


On Nov. 28, 2013, 6:36 a.m., Swapnil Ghike wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/15901/
> -----------------------------------------------------------
> 
> (Updated Nov. 28, 2013, 6:36 a.m.)
> 
> 
> Review request for kafka.
> 
> 
> Bugs: KAFKA-1152
>     https://issues.apache.org/jira/browse/KAFKA-1152
> 
> 
> Repository: kafka
> 
> 
> Description
> -------
> 
> ReplicaManager's handling of the leaderAndIsrRequest should gracefully handle leader == -1
> 
> 
> Diffs
> -----
> 
>   core/src/main/scala/kafka/server/ReplicaManager.scala 161f58134f20f9335dbd2bee6ac3f71897cbef7c 
> 
> Diff: https://reviews.apache.org/r/15901/diff/
> 
> 
> Testing
> -------
> 
> Builds with all scala versions; unit tests pass
> 
> 
> Thanks,
> 
> Swapnil Ghike
> 
>


Re: Review Request 15901: Patch for KAFKA-1152

Posted by Swapnil Ghike <sg...@linkedin.com>.

> On Dec. 2, 2013, 5:06 p.m., Neha Narkhede wrote:
> > core/src/main/scala/kafka/server/ReplicaManager.scala, line 358
> > <https://reviews.apache.org/r/15901/diff/3/?file=392523#file392523line358>
> >
> >     the check should probably be leaderId >= 0. The "leaders" in the LeaderAndIsrRequest is misleading, cannot be trusted and needs to be deprecated.

On the controller, leaders exclude shutdown brokers. 

val leaders = controllerContext.liveOrShuttingDownBrokers.filter(b => leaderIds.contains(b.id))

On the broker, should we not check whether the leader that it is being asked to follow is alive or not?


- Swapnil


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/15901/#review29588
-----------------------------------------------------------


On Nov. 29, 2013, 6:41 a.m., Swapnil Ghike wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/15901/
> -----------------------------------------------------------
> 
> (Updated Nov. 29, 2013, 6:41 a.m.)
> 
> 
> Review request for kafka.
> 
> 
> Bugs: KAFKA-1152
>     https://issues.apache.org/jira/browse/KAFKA-1152
> 
> 
> Repository: kafka
> 
> 
> Description
> -------
> 
> ReplicaManager's handling of the leaderAndIsrRequest should gracefully handle leader == -1
> 
> 
> ReplicaManager's handling of the leaderAndIsrRequest should gracefully handle leader == -1
> 
> 
> Diffs
> -----
> 
>   core/src/main/scala/kafka/server/ReplicaManager.scala 161f58134f20f9335dbd2bee6ac3f71897cbef7c 
> 
> Diff: https://reviews.apache.org/r/15901/diff/
> 
> 
> Testing
> -------
> 
> Builds with all scala versions; unit tests pass
> 
> 
> Thanks,
> 
> Swapnil Ghike
> 
>


Re: Review Request 15901: Patch for KAFKA-1152

Posted by Neha Narkhede <ne...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/15901/#review29588
-----------------------------------------------------------



core/src/main/scala/kafka/server/ReplicaManager.scala
<https://reviews.apache.org/r/15901/#comment56984>

    the check should probably be leaderId >= 0. The "leaders" in the LeaderAndIsrRequest is misleading, cannot be trusted and needs to be deprecated.



core/src/main/scala/kafka/server/ReplicaManager.scala
<https://reviews.apache.org/r/15901/#comment56983>

    this format statement is broken. We need a parentheses surrounding the entire trace statement


- Neha Narkhede


On Nov. 29, 2013, 6:41 a.m., Swapnil Ghike wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/15901/
> -----------------------------------------------------------
> 
> (Updated Nov. 29, 2013, 6:41 a.m.)
> 
> 
> Review request for kafka.
> 
> 
> Bugs: KAFKA-1152
>     https://issues.apache.org/jira/browse/KAFKA-1152
> 
> 
> Repository: kafka
> 
> 
> Description
> -------
> 
> ReplicaManager's handling of the leaderAndIsrRequest should gracefully handle leader == -1
> 
> 
> ReplicaManager's handling of the leaderAndIsrRequest should gracefully handle leader == -1
> 
> 
> Diffs
> -----
> 
>   core/src/main/scala/kafka/server/ReplicaManager.scala 161f58134f20f9335dbd2bee6ac3f71897cbef7c 
> 
> Diff: https://reviews.apache.org/r/15901/diff/
> 
> 
> Testing
> -------
> 
> Builds with all scala versions; unit tests pass
> 
> 
> Thanks,
> 
> Swapnil Ghike
> 
>


Re: Review Request 15901: Patch for KAFKA-1152

Posted by Swapnil Ghike <sg...@linkedin.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/15901/
-----------------------------------------------------------

(Updated Nov. 29, 2013, 6:41 a.m.)


Review request for kafka.


Bugs: KAFKA-1152
    https://issues.apache.org/jira/browse/KAFKA-1152


Repository: kafka


Description (updated)
-------

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


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


Diffs (updated)
-----

  core/src/main/scala/kafka/server/ReplicaManager.scala 161f58134f20f9335dbd2bee6ac3f71897cbef7c 

Diff: https://reviews.apache.org/r/15901/diff/


Testing
-------

Builds with all scala versions; unit tests pass


Thanks,

Swapnil Ghike


Re: Review Request 15901: Patch for KAFKA-1152

Posted by Jun Rao <ju...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/15901/#review29554
-----------------------------------------------------------



core/src/main/scala/kafka/server/ReplicaManager.scala
<https://reviews.apache.org/r/15901/#comment56906>

    Could we use case match here? Then, we don't need to call leaders.find() again.



core/src/main/scala/kafka/server/ReplicaManager.scala
<https://reviews.apache.org/r/15901/#comment56904>

    Could we use map.put() since it's used in other places?



core/src/main/scala/kafka/server/ReplicaManager.scala
<https://reviews.apache.org/r/15901/#comment56905>

    The ordering of leader and partition is incorrect.


- Jun Rao


On Nov. 28, 2013, 6:19 p.m., Swapnil Ghike wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/15901/
> -----------------------------------------------------------
> 
> (Updated Nov. 28, 2013, 6:19 p.m.)
> 
> 
> Review request for kafka.
> 
> 
> Bugs: KAFKA-1152
>     https://issues.apache.org/jira/browse/KAFKA-1152
> 
> 
> Repository: kafka
> 
> 
> Description
> -------
> 
> ReplicaManager's handling of the leaderAndIsrRequest should gracefully handle leader == -1
> 
> 
> Diffs
> -----
> 
>   core/src/main/scala/kafka/server/ReplicaManager.scala 161f58134f20f9335dbd2bee6ac3f71897cbef7c 
> 
> Diff: https://reviews.apache.org/r/15901/diff/
> 
> 
> Testing
> -------
> 
> Builds with all scala versions; unit tests pass
> 
> 
> Thanks,
> 
> Swapnil Ghike
> 
>


Re: Review Request 15901: Patch for KAFKA-1152

Posted by Swapnil Ghike <sg...@linkedin.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/15901/
-----------------------------------------------------------

(Updated Nov. 28, 2013, 6:19 p.m.)


Review request for kafka.


Summary (updated)
-----------------

Patch for KAFKA-1152


Bugs: KAFKA-1152
    https://issues.apache.org/jira/browse/KAFKA-1152


Repository: kafka


Description
-------

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


Diffs (updated)
-----

  core/src/main/scala/kafka/server/ReplicaManager.scala 161f58134f20f9335dbd2bee6ac3f71897cbef7c 

Diff: https://reviews.apache.org/r/15901/diff/


Testing
-------

Builds with all scala versions; unit tests pass


Thanks,

Swapnil Ghike


Re: Review Request 15901: ReplicaManager's handling of the leaderAndIsrRequest should gracefully handle leader == -1

Posted by Swapnil Ghike <sg...@linkedin.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/15901/
-----------------------------------------------------------

(Updated Nov. 28, 2013, 6:36 a.m.)


Review request for kafka.


Bugs: KAFKA-1152
    https://issues.apache.org/jira/browse/KAFKA-1152


Repository: kafka


Description
-------

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


Diffs
-----

  core/src/main/scala/kafka/server/ReplicaManager.scala 161f58134f20f9335dbd2bee6ac3f71897cbef7c 

Diff: https://reviews.apache.org/r/15901/diff/


Testing (updated)
-------

Builds with all scala versions; unit tests pass


Thanks,

Swapnil Ghike