Re: Review Request 18712: Patch for KAFKA-1281

2014-03-04 Thread Neha Narkhede

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

(Updated March 4, 2014, 6:47 p.m.)


Review request for kafka.


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


Repository: kafka


Description (updated)
---

Found a few problems with the current tools. 1) Moved TestLogCleaning and 
TestEndToEndLatency to under tools so we can run those using 
bin/kafka-run-class.sh 2) TestLogCleaning seems to hang while sending data 
using the new producer. Will file a JIRA to track this


First pass at refactoring tools to use the new producer


Diffs (updated)
-

  core/src/main/scala/kafka/producer/ConsoleProducer.scala 
28de57304db6a7c79c4c75de155f6389144eb5a5 
  core/src/main/scala/kafka/producer/KafkaLog4jAppender.scala 
42239b27ab26725141f4bf525d2d69538979dd44 
  core/src/main/scala/kafka/tools/ReplayLogProducer.scala 
814d61ae477cef5e56723e1f1a86c3b2e9b7c1ea 
  core/src/main/scala/kafka/utils/CommandLineUtils.scala 
726c30257dcb55b8989163dab3bfc6888dd5d931 
  core/src/test/scala/other/kafka/TestEndToEndLatency.scala 
f5d39dd71ad25b0d9955d4b9bcdb56ba705abff0 
  core/src/test/scala/other/kafka/TestLogCleaning.scala 
22b16e54980e30f60dbf2fbe46c16398d654ba21 

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


Testing
---


Thanks,

Neha Narkhede



Re: Review Request 18712: Patch for KAFKA-1281

2014-03-04 Thread Neha Narkhede

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

(Updated March 4, 2014, 6:48 p.m.)


Review request for kafka.


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


Repository: kafka


Description (updated)
---


Found a few problems with the current tools. 1) Moved TestLogCleaning and 
TestEndToEndLatency to under tools so we can run those using 
bin/kafka-run-class.sh 2) TestLogCleaning seems to hang while sending data 
using the new producer. Will file a JIRA to track this


First pass at refactoring tools to use the new producer. As per agreement on 
KAFKA-1281, only ConsoleProducer and ProducerPerformance have the option of 
using the 2 producers. Rest are converted over to use the new producer. 
KafkaLog4jAppender needs an overhaul, I think. For this patch, I've just 
converted it to use the new producer and deleted configs that only make sense 
for the old producer.


Diffs
-

  core/src/main/scala/kafka/producer/ConsoleProducer.scala 
28de57304db6a7c79c4c75de155f6389144eb5a5 
  core/src/main/scala/kafka/producer/KafkaLog4jAppender.scala 
42239b27ab26725141f4bf525d2d69538979dd44 
  core/src/main/scala/kafka/tools/ReplayLogProducer.scala 
814d61ae477cef5e56723e1f1a86c3b2e9b7c1ea 
  core/src/main/scala/kafka/utils/CommandLineUtils.scala 
726c30257dcb55b8989163dab3bfc6888dd5d931 
  core/src/test/scala/other/kafka/TestEndToEndLatency.scala 
f5d39dd71ad25b0d9955d4b9bcdb56ba705abff0 
  core/src/test/scala/other/kafka/TestLogCleaning.scala 
22b16e54980e30f60dbf2fbe46c16398d654ba21 

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


Testing
---


Thanks,

Neha Narkhede



[jira] [Commented] (KAFKA-1281) add the new producer to existing tools

2014-03-04 Thread Neha Narkhede (JIRA)

[ 
https://issues.apache.org/jira/browse/KAFKA-1281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13919752#comment-13919752
 ] 

Neha Narkhede commented on KAFKA-1281:
--

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

> add the new producer to existing tools
> --
>
> Key: KAFKA-1281
> URL: https://issues.apache.org/jira/browse/KAFKA-1281
> Project: Kafka
>  Issue Type: Sub-task
>  Components: producer 
>Affects Versions: 0.8.2
>Reporter: Jun Rao
>Assignee: Neha Narkhede
> Fix For: 0.9.0
>
> Attachments: KAFKA-1281.patch, KAFKA-1281_2014-03-04_10:47:36.patch
>
>
> Need to create a new version of a few existing tools using the new producer. 
> Those tools include: 
> * ConsoleProducer
> * KafkaLog4jAppender
> * TestEndToEndLatency
> * TestLogCleaning
> * ReplayLogProducer
> Not sure about ReplayLogProducer since it seems to be just a specialized 
> version of MirrorMaker.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (KAFKA-1281) add the new producer to existing tools

2014-03-04 Thread Neha Narkhede (JIRA)

 [ 
https://issues.apache.org/jira/browse/KAFKA-1281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Neha Narkhede updated KAFKA-1281:
-

Attachment: KAFKA-1281_2014-03-04_10:47:36.patch

> add the new producer to existing tools
> --
>
> Key: KAFKA-1281
> URL: https://issues.apache.org/jira/browse/KAFKA-1281
> Project: Kafka
>  Issue Type: Sub-task
>  Components: producer 
>Affects Versions: 0.8.2
>Reporter: Jun Rao
>Assignee: Neha Narkhede
> Fix For: 0.9.0
>
> Attachments: KAFKA-1281.patch, KAFKA-1281_2014-03-04_10:47:36.patch
>
>
> Need to create a new version of a few existing tools using the new producer. 
> Those tools include: 
> * ConsoleProducer
> * KafkaLog4jAppender
> * TestEndToEndLatency
> * TestLogCleaning
> * ReplayLogProducer
> Not sure about ReplayLogProducer since it seems to be just a specialized 
> version of MirrorMaker.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Review Request 18740: Fix KAFKA-1286

2014-03-04 Thread Guozhang Wang

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

Review request for kafka.


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


Repository: kafka


Description
---

KAFKA-1286.v1


KAFKA-1253.v1


Fix K1258


Debug producer block issue on retry


Diffs
-

  clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java 
bedd2a989a62b1ed53f006e7e2f8bd1bdc5dfa5b 
  clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java 
d8e35e7d0e4cd27aad9a8d4bf14bc97458da9417 
  
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java
 699027447145837495fb56b41ad9ee5e9cb60240 
  
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordBatch.java
 c7fbf3c06858a6016878667b68ee29b22b604f7d 
  clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java 
794262394133d8e10e52971dccc0082d3aa75047 
  clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java 
21a2592ea7c7f5d4831669196cf4e2d2b4e9bcf5 
  core/src/main/scala/kafka/controller/KafkaController.scala 
b58cdcd16ffb62ba5329b8b2776f2bd18440b3a0 
  core/src/main/scala/kafka/log/LogManager.scala 
10062af1e02af5e4238f408ba5b9f98cc226244f 

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


Testing
---


Thanks,

Guozhang Wang



[jira] [Commented] (KAFKA-1286) Retry Can Block

2014-03-04 Thread Guozhang Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/KAFKA-1286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13919756#comment-13919756
 ] 

Guozhang Wang commented on KAFKA-1286:
--

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

> Retry Can Block 
> 
>
> Key: KAFKA-1286
> URL: https://issues.apache.org/jira/browse/KAFKA-1286
> Project: Kafka
>  Issue Type: Sub-task
>  Components: producer 
>Reporter: Guozhang Wang
> Attachments: KAFKA-1286.patch
>
>
> Under the following scenario the retry logic can block
> 1. The last broker's socket closed, sender.handleDisconnect() triggered, put 
> the node as disconnected.
> 2. In the next sender.run(), since the node is disconnected, remove the 
> partition from ready set, and call sender.initConnection(), which will not 
> throw exception.
> 3. So in this round of send, the only request it tries to send to is the 
> metadata request, to the last broker; and the sender will firstly try to 
> connect to that broker.
> 4. In selector.poll(), the finishConnect() call will throw exception, and in 
> handleDisconnects(), inFlight request's batches will be null since it is a 
> metadata request.
> 5. Now we will go back to 1, and loop forever. Note that this infinite loop 
> can be triggered even without calling producer.close.
> Also, we need to introduce the retry backoff config, otherwise the retries 
> will be exhausted too soon (in my tests 10 retries can be exhausted in about 
> 600ms).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (KAFKA-1286) Retry Can Block

2014-03-04 Thread Guozhang Wang (JIRA)

 [ 
https://issues.apache.org/jira/browse/KAFKA-1286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Guozhang Wang updated KAFKA-1286:
-

Attachment: KAFKA-1286.patch

> Retry Can Block 
> 
>
> Key: KAFKA-1286
> URL: https://issues.apache.org/jira/browse/KAFKA-1286
> Project: Kafka
>  Issue Type: Sub-task
>  Components: producer 
>Reporter: Guozhang Wang
> Attachments: KAFKA-1286.patch
>
>
> Under the following scenario the retry logic can block
> 1. The last broker's socket closed, sender.handleDisconnect() triggered, put 
> the node as disconnected.
> 2. In the next sender.run(), since the node is disconnected, remove the 
> partition from ready set, and call sender.initConnection(), which will not 
> throw exception.
> 3. So in this round of send, the only request it tries to send to is the 
> metadata request, to the last broker; and the sender will firstly try to 
> connect to that broker.
> 4. In selector.poll(), the finishConnect() call will throw exception, and in 
> handleDisconnects(), inFlight request's batches will be null since it is a 
> metadata request.
> 5. Now we will go back to 1, and loop forever. Note that this infinite loop 
> can be triggered even without calling producer.close.
> Also, we need to introduce the retry backoff config, otherwise the retries 
> will be exhausted too soon (in my tests 10 retries can be exhausted in about 
> 600ms).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Re: Review Request 18740: Fix KAFKA-1286

2014-03-04 Thread Guozhang Wang

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

(Updated March 4, 2014, 6:56 p.m.)


Review request for kafka.


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


Repository: kafka


Description (updated)
---

1. Fix the metadata-in-progree flag issue.

2. Add backoff config for retry.

3. Some logging level changes.

4. Fix a minor NPE bug in delete-topic-manager.

5. Rolling bounce test case.


Diffs
-

  clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java 
bedd2a989a62b1ed53f006e7e2f8bd1bdc5dfa5b 
  clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java 
d8e35e7d0e4cd27aad9a8d4bf14bc97458da9417 
  
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java
 699027447145837495fb56b41ad9ee5e9cb60240 
  
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordBatch.java
 c7fbf3c06858a6016878667b68ee29b22b604f7d 
  clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java 
794262394133d8e10e52971dccc0082d3aa75047 
  clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java 
21a2592ea7c7f5d4831669196cf4e2d2b4e9bcf5 
  core/src/main/scala/kafka/controller/KafkaController.scala 
b58cdcd16ffb62ba5329b8b2776f2bd18440b3a0 
  core/src/main/scala/kafka/log/LogManager.scala 
10062af1e02af5e4238f408ba5b9f98cc226244f 

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


Testing (updated)
---

integration tests


Thanks,

Guozhang Wang



[jira] [Created] (KAFKA-1290) TestLogCleaning tool hangs on the new producer

2014-03-04 Thread Neha Narkhede (JIRA)
Neha Narkhede created KAFKA-1290:


 Summary: TestLogCleaning tool hangs on the new producer
 Key: KAFKA-1290
 URL: https://issues.apache.org/jira/browse/KAFKA-1290
 Project: Kafka
  Issue Type: Sub-task
  Components: producer 
Affects Versions: 0.9.0
Reporter: Neha Narkhede
Assignee: Jun Rao
Priority: Blocker


KAFKA-1281 (yet to be checked in) converted existing tools to use the new 
producer. I found that TestLogCleaning hangs while sending messages using the 
new producer. Following is a thread dump and steps to reproduce the issue.

nnarkhed-mn1:kafka-git-idea nnarkhed$ ./bin/kafka-run-class.sh 
kafka.TestLogCleaning --broker localhost:9092 --topics 1 --zk localhost:2181 
--messages 10
Producing 10 messages...
Logging produce requests to 
/var/folders/61/bspy8z8n1t5dn5sdqzsnhbdr000383/T/kafka-log-cleaner-produced-3744326506335955516.txt
2014-03-04 10:51:35
Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.65-b04-462 mixed mode):

"kafka-network-thread" daemon prio=5 tid=7fc27e94c000 nid=0x10a643000 runnable 
[10a642000]
   java.lang.Thread.State: RUNNABLE
at sun.nio.ch.KQueueArrayWrapper.kevent0(Native Method)
at sun.nio.ch.KQueueArrayWrapper.poll(KQueueArrayWrapper.java:136)
at sun.nio.ch.KQueueSelectorImpl.doSelect(KQueueSelectorImpl.java:69)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)
- locked <7ec0b0170> (a sun.nio.ch.Util$2)
- locked <7ec0b0180> (a java.util.Collections$UnmodifiableSet)
- locked <7ec0b0128> (a sun.nio.ch.KQueueSelectorImpl)
at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
at org.apache.kafka.common.network.Selector.select(Selector.java:296)
at org.apache.kafka.common.network.Selector.poll(Selector.java:198)
at 
org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:153)
at 
org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:98)
at java.lang.Thread.run(Thread.java:695)

"RMI TCP Accept-0" daemon prio=5 tid=7fc27e99c800 nid=0x10a43d000 runnable 
[10a43c000]
   java.lang.Thread.State: RUNNABLE
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:439)
- locked <7ec0b6088> (a java.net.SocksSocketImpl)
at java.net.ServerSocket.implAccept(ServerSocket.java:468)
at java.net.ServerSocket.accept(ServerSocket.java:436)
at 
sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:34)
at 
sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:369)
at 
sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:341)
at java.lang.Thread.run(Thread.java:695)

"AWT-AppKit" daemon prio=5 tid=7fc27f83 nid=0x7fff7b984180 runnable 
[]
   java.lang.Thread.State: RUNNABLE

"Low Memory Detector" daemon prio=5 tid=7fc27e8db000 nid=0x109b3 runnable 
[]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" daemon prio=9 tid=7fc27e8da800 nid=0x109a2d000 waiting on 
condition []
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" daemon prio=9 tid=7fc27e8d9800 nid=0x10992a000 waiting on 
condition []
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" daemon prio=9 tid=7fc27e8d9000 nid=0x109827000 waiting on 
condition []
   java.lang.Thread.State: RUNNABLE

"Surrogate Locker Thread (Concurrent GC)" daemon prio=5 tid=7fc27e002000 
nid=0x109724000 waiting on condition []
   java.lang.Thread.State: RUNNABLE

"Finalizer" daemon prio=8 tid=7fc27e8d8000 nid=0x109519000 in Object.wait() 
[109518000]
   java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <7ec0b23b0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
- locked <7ec0b23b0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:171)

"Reference Handler" daemon prio=10 tid=7fc27e8d7800 nid=0x109416000 in 
Object.wait() [109415000]
   java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <7ec0b4000> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:485)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
- locked <7ec0b4000> (a java.lang.ref.Reference$Lock)

"main" prio=5 tid=7fc27e000800 nid=0x102159000 in Object.wait() [102158000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <7ec0b23e0> (a 
org.apache.ka

[jira] [Updated] (KAFKA-1290) TestLogCleaning tool hangs on the new producer

2014-03-04 Thread Neha Narkhede (JIRA)

 [ 
https://issues.apache.org/jira/browse/KAFKA-1290?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Neha Narkhede updated KAFKA-1290:
-

Assignee: (was: Jun Rao)

> TestLogCleaning tool hangs on the new producer
> --
>
> Key: KAFKA-1290
> URL: https://issues.apache.org/jira/browse/KAFKA-1290
> Project: Kafka
>  Issue Type: Sub-task
>  Components: producer 
>Affects Versions: 0.9.0
>Reporter: Neha Narkhede
>Priority: Blocker
>
> KAFKA-1281 (yet to be checked in) converted existing tools to use the new 
> producer. I found that TestLogCleaning hangs while sending messages using the 
> new producer. Following is a thread dump and steps to reproduce the issue.
> nnarkhed-mn1:kafka-git-idea nnarkhed$ ./bin/kafka-run-class.sh 
> kafka.TestLogCleaning --broker localhost:9092 --topics 1 --zk localhost:2181 
> --messages 10
> Producing 10 messages...
> Logging produce requests to 
> /var/folders/61/bspy8z8n1t5dn5sdqzsnhbdr000383/T/kafka-log-cleaner-produced-3744326506335955516.txt
> 2014-03-04 10:51:35
> Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.65-b04-462 mixed mode):
> "kafka-network-thread" daemon prio=5 tid=7fc27e94c000 nid=0x10a643000 
> runnable [10a642000]
>java.lang.Thread.State: RUNNABLE
>   at sun.nio.ch.KQueueArrayWrapper.kevent0(Native Method)
>   at sun.nio.ch.KQueueArrayWrapper.poll(KQueueArrayWrapper.java:136)
>   at sun.nio.ch.KQueueSelectorImpl.doSelect(KQueueSelectorImpl.java:69)
>   at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)
>   - locked <7ec0b0170> (a sun.nio.ch.Util$2)
>   - locked <7ec0b0180> (a java.util.Collections$UnmodifiableSet)
>   - locked <7ec0b0128> (a sun.nio.ch.KQueueSelectorImpl)
>   at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
>   at org.apache.kafka.common.network.Selector.select(Selector.java:296)
>   at org.apache.kafka.common.network.Selector.poll(Selector.java:198)
>   at 
> org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:153)
>   at 
> org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:98)
>   at java.lang.Thread.run(Thread.java:695)
> "RMI TCP Accept-0" daemon prio=5 tid=7fc27e99c800 nid=0x10a43d000 runnable 
> [10a43c000]
>java.lang.Thread.State: RUNNABLE
>   at java.net.PlainSocketImpl.socketAccept(Native Method)
>   at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:439)
>   - locked <7ec0b6088> (a java.net.SocksSocketImpl)
>   at java.net.ServerSocket.implAccept(ServerSocket.java:468)
>   at java.net.ServerSocket.accept(ServerSocket.java:436)
>   at 
> sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:34)
>   at 
> sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:369)
>   at 
> sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:341)
>   at java.lang.Thread.run(Thread.java:695)
> "AWT-AppKit" daemon prio=5 tid=7fc27f83 nid=0x7fff7b984180 runnable 
> []
>java.lang.Thread.State: RUNNABLE
> "Low Memory Detector" daemon prio=5 tid=7fc27e8db000 nid=0x109b3 runnable 
> []
>java.lang.Thread.State: RUNNABLE
> "C2 CompilerThread1" daemon prio=9 tid=7fc27e8da800 nid=0x109a2d000 waiting 
> on condition []
>java.lang.Thread.State: RUNNABLE
> "C2 CompilerThread0" daemon prio=9 tid=7fc27e8d9800 nid=0x10992a000 waiting 
> on condition []
>java.lang.Thread.State: RUNNABLE
> "Signal Dispatcher" daemon prio=9 tid=7fc27e8d9000 nid=0x109827000 waiting on 
> condition []
>java.lang.Thread.State: RUNNABLE
> "Surrogate Locker Thread (Concurrent GC)" daemon prio=5 tid=7fc27e002000 
> nid=0x109724000 waiting on condition []
>java.lang.Thread.State: RUNNABLE
> "Finalizer" daemon prio=8 tid=7fc27e8d8000 nid=0x109519000 in Object.wait() 
> [109518000]
>java.lang.Thread.State: WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <7ec0b23b0> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
>   - locked <7ec0b23b0> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
>   at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:171)
> "Reference Handler" daemon prio=10 tid=7fc27e8d7800 nid=0x109416000 in 
> Object.wait() [109415000]
>java.lang.Thread.State: WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <7ec0b4000> (a java.lang.ref.Reference$Lock)
>   at java.lang.Object.wait(Object.java:485)
>   at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
>   - locked <7ec0b4000> (a java.lang.ref.Ref

Re: Review Request 18740: Fix KAFKA-1286

2014-03-04 Thread Guozhang Wang

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

(Updated March 4, 2014, 7:04 p.m.)


Review request for kafka.


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


Repository: kafka


Description (updated)
---

Add the failure handling test case


KAFKA-1286.v1


KAFKA-1253.v1


Fix K1258


Debug producer block issue on retry


Diffs (updated)
-

  clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java 
bedd2a989a62b1ed53f006e7e2f8bd1bdc5dfa5b 
  clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java 
d8e35e7d0e4cd27aad9a8d4bf14bc97458da9417 
  
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java
 699027447145837495fb56b41ad9ee5e9cb60240 
  
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordBatch.java
 c7fbf3c06858a6016878667b68ee29b22b604f7d 
  clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java 
794262394133d8e10e52971dccc0082d3aa75047 
  clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java 
21a2592ea7c7f5d4831669196cf4e2d2b4e9bcf5 
  core/src/main/scala/kafka/controller/KafkaController.scala 
b58cdcd16ffb62ba5329b8b2776f2bd18440b3a0 
  core/src/main/scala/kafka/log/LogManager.scala 
10062af1e02af5e4238f408ba5b9f98cc226244f 
  core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala 
4b7c544594dba734c8875fce2a289f81d67ba291 

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


Testing
---

integration tests


Thanks,

Guozhang Wang



Re: Review Request 18740: Fix KAFKA-1286

2014-03-04 Thread Guozhang Wang

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

(Updated March 4, 2014, 7:05 p.m.)


Review request for kafka.


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


Repository: kafka


Description (updated)
---

1. Fix the metadata-in-progree flag issue.

2. Add backoff config for retry.

3. Some logging level changes.

4. Fix a minor NPE bug in delete-topic-manager.

5. Rolling bounce test case.


Diffs
-

  clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java 
bedd2a989a62b1ed53f006e7e2f8bd1bdc5dfa5b 
  clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java 
d8e35e7d0e4cd27aad9a8d4bf14bc97458da9417 
  
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java
 699027447145837495fb56b41ad9ee5e9cb60240 
  
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordBatch.java
 c7fbf3c06858a6016878667b68ee29b22b604f7d 
  clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java 
794262394133d8e10e52971dccc0082d3aa75047 
  clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java 
21a2592ea7c7f5d4831669196cf4e2d2b4e9bcf5 
  core/src/main/scala/kafka/controller/KafkaController.scala 
b58cdcd16ffb62ba5329b8b2776f2bd18440b3a0 
  core/src/main/scala/kafka/log/LogManager.scala 
10062af1e02af5e4238f408ba5b9f98cc226244f 
  core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala 
4b7c544594dba734c8875fce2a289f81d67ba291 

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


Testing
---

integration tests


Thanks,

Guozhang Wang



[jira] [Commented] (KAFKA-1286) Retry Can Block

2014-03-04 Thread Guozhang Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/KAFKA-1286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13919775#comment-13919775
 ] 

Guozhang Wang commented on KAFKA-1286:
--

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

> Retry Can Block 
> 
>
> Key: KAFKA-1286
> URL: https://issues.apache.org/jira/browse/KAFKA-1286
> Project: Kafka
>  Issue Type: Sub-task
>  Components: producer 
>Reporter: Guozhang Wang
> Attachments: KAFKA-1286.patch, KAFKA-1286_2014-03-04_11:04:32.patch
>
>
> Under the following scenario the retry logic can block
> 1. The last broker's socket closed, sender.handleDisconnect() triggered, put 
> the node as disconnected.
> 2. In the next sender.run(), since the node is disconnected, remove the 
> partition from ready set, and call sender.initConnection(), which will not 
> throw exception.
> 3. So in this round of send, the only request it tries to send to is the 
> metadata request, to the last broker; and the sender will firstly try to 
> connect to that broker.
> 4. In selector.poll(), the finishConnect() call will throw exception, and in 
> handleDisconnects(), inFlight request's batches will be null since it is a 
> metadata request.
> 5. Now we will go back to 1, and loop forever. Note that this infinite loop 
> can be triggered even without calling producer.close.
> Also, we need to introduce the retry backoff config, otherwise the retries 
> will be exhausted too soon (in my tests 10 retries can be exhausted in about 
> 600ms).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (KAFKA-1286) Retry Can Block

2014-03-04 Thread Guozhang Wang (JIRA)

 [ 
https://issues.apache.org/jira/browse/KAFKA-1286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Guozhang Wang updated KAFKA-1286:
-

Attachment: KAFKA-1286_2014-03-04_11:04:32.patch

> Retry Can Block 
> 
>
> Key: KAFKA-1286
> URL: https://issues.apache.org/jira/browse/KAFKA-1286
> Project: Kafka
>  Issue Type: Sub-task
>  Components: producer 
>Reporter: Guozhang Wang
> Attachments: KAFKA-1286.patch, KAFKA-1286_2014-03-04_11:04:32.patch
>
>
> Under the following scenario the retry logic can block
> 1. The last broker's socket closed, sender.handleDisconnect() triggered, put 
> the node as disconnected.
> 2. In the next sender.run(), since the node is disconnected, remove the 
> partition from ready set, and call sender.initConnection(), which will not 
> throw exception.
> 3. So in this round of send, the only request it tries to send to is the 
> metadata request, to the last broker; and the sender will firstly try to 
> connect to that broker.
> 4. In selector.poll(), the finishConnect() call will throw exception, and in 
> handleDisconnects(), inFlight request's batches will be null since it is a 
> metadata request.
> 5. Now we will go back to 1, and loop forever. Note that this infinite loop 
> can be triggered even without calling producer.close.
> Also, we need to introduce the retry backoff config, otherwise the retries 
> will be exhausted too soon (in my tests 10 retries can be exhausted in about 
> 600ms).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Re: Review Request 18712: Patch for KAFKA-1281

2014-03-04 Thread Jun Rao

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


Got the following warning when running console-producer with --new-producer.

[2014-03-04 11:25:24,007] WARN The configuration 
topic.metadata.refresh.interval.ms = 500 was supplied but isn't a known config. 
(org.apache.kafka.clients.producer.ProducerConfig)
[2014-03-04 11:25:24,008] WARN The configuration compression.codec = null was 
supplied but isn't a known config. 
(org.apache.kafka.clients.producer.ProducerConfig)



core/src/main/scala/kafka/producer/ConsoleProducer.scala


We probably don't need to distinguish btw sending with and w/o key. By 
default, if the key is provided, the producer already picks a partition based 
on the hash of the key.



core/src/main/scala/kafka/producer/ConsoleProducer.scala


If we are sending in sync mode, we need to call get() on the returned 
future object.



core/src/main/scala/kafka/tools/ReplayLogProducer.scala


This probably needs to stay and we need to call get() on the returned 
future object during send() if in sync mode.



core/src/main/scala/kafka/tools/ReplayLogProducer.scala


Do we need to provide the partition #? The target cluster may not have the 
same # partitions as that in the source cluster.



core/src/test/scala/other/kafka/TestEndToEndLatency.scala


We need to call get() on the returned future object.


- Jun Rao


On March 4, 2014, 6:48 p.m., Neha Narkhede wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18712/
> ---
> 
> (Updated March 4, 2014, 6:48 p.m.)
> 
> 
> Review request for kafka.
> 
> 
> Bugs: KAFKA-1281
> https://issues.apache.org/jira/browse/KAFKA-1281
> 
> 
> Repository: kafka
> 
> 
> Description
> ---
> 
> 
> Found a few problems with the current tools. 1) Moved TestLogCleaning and 
> TestEndToEndLatency to under tools so we can run those using 
> bin/kafka-run-class.sh 2) TestLogCleaning seems to hang while sending data 
> using the new producer. Will file a JIRA to track this
> 
> 
> First pass at refactoring tools to use the new producer. As per agreement on 
> KAFKA-1281, only ConsoleProducer and ProducerPerformance have the option of 
> using the 2 producers. Rest are converted over to use the new producer. 
> KafkaLog4jAppender needs an overhaul, I think. For this patch, I've just 
> converted it to use the new producer and deleted configs that only make sense 
> for the old producer.
> 
> 
> Diffs
> -
> 
>   core/src/main/scala/kafka/producer/ConsoleProducer.scala 
> 28de57304db6a7c79c4c75de155f6389144eb5a5 
>   core/src/main/scala/kafka/producer/KafkaLog4jAppender.scala 
> 42239b27ab26725141f4bf525d2d69538979dd44 
>   core/src/main/scala/kafka/tools/ReplayLogProducer.scala 
> 814d61ae477cef5e56723e1f1a86c3b2e9b7c1ea 
>   core/src/main/scala/kafka/utils/CommandLineUtils.scala 
> 726c30257dcb55b8989163dab3bfc6888dd5d931 
>   core/src/test/scala/other/kafka/TestEndToEndLatency.scala 
> f5d39dd71ad25b0d9955d4b9bcdb56ba705abff0 
>   core/src/test/scala/other/kafka/TestLogCleaning.scala 
> 22b16e54980e30f60dbf2fbe46c16398d654ba21 
> 
> Diff: https://reviews.apache.org/r/18712/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Neha Narkhede
> 
>



[jira] [Resolved] (KAFKA-1289) Misc. nitpicks in log cleaner

2014-03-04 Thread Joe Stein (JIRA)

 [ 
https://issues.apache.org/jira/browse/KAFKA-1289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joe Stein resolved KAFKA-1289.
--

   Resolution: Fixed
Fix Version/s: 0.8.1

applying to 0.8.1 branch

> Misc. nitpicks in log cleaner
> -
>
> Key: KAFKA-1289
> URL: https://issues.apache.org/jira/browse/KAFKA-1289
> Project: Kafka
>  Issue Type: Bug
>Affects Versions: 0.8.1
>Reporter: Jay Kreps
> Fix For: 0.8.1
>
> Attachments: KAFKA-1289-v1.patch
>
>
> There are a couple of minor annoyances in the log cleaner in 0.8.1. Since 
> this is one of the major features it would be nice to address these.
> Problems:
> 1. Logging is no longer going to the kafka-cleaner.log 
> 2. Shutdown when the log cleaner is enabled is very slow
> 3. TestLogCleaner uses obsolete properties for the producer and consumer
> In addition I want to change the configuration from "dedupe" to "compact" as 
> we don't use the terminology dedupe anywhere else and I think it is less 
> intuitive.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (KAFKA-1289) Misc. nitpicks in log cleaner

2014-03-04 Thread Joe Stein (JIRA)

[ 
https://issues.apache.org/jira/browse/KAFKA-1289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13919889#comment-13919889
 ] 

Joe Stein commented on KAFKA-1289:
--

committed to 0.8.1 and trunk, thanks!!!

> Misc. nitpicks in log cleaner
> -
>
> Key: KAFKA-1289
> URL: https://issues.apache.org/jira/browse/KAFKA-1289
> Project: Kafka
>  Issue Type: Bug
>Affects Versions: 0.8.1
>Reporter: Jay Kreps
> Fix For: 0.8.1
>
> Attachments: KAFKA-1289-v1.patch
>
>
> There are a couple of minor annoyances in the log cleaner in 0.8.1. Since 
> this is one of the major features it would be nice to address these.
> Problems:
> 1. Logging is no longer going to the kafka-cleaner.log 
> 2. Shutdown when the log cleaner is enabled is very slow
> 3. TestLogCleaner uses obsolete properties for the producer and consumer
> In addition I want to change the configuration from "dedupe" to "compact" as 
> we don't use the terminology dedupe anywhere else and I think it is less 
> intuitive.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Resolved] (KAFKA-1288) add enclosing dir in release tar gz

2014-03-04 Thread Joe Stein (JIRA)

 [ 
https://issues.apache.org/jira/browse/KAFKA-1288?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joe Stein resolved KAFKA-1288.
--

   Resolution: Fixed
Fix Version/s: 0.8.1

applying to 0.8.1

> add enclosing dir in release tar gz
> ---
>
> Key: KAFKA-1288
> URL: https://issues.apache.org/jira/browse/KAFKA-1288
> Project: Kafka
>  Issue Type: Bug
>  Components: packaging
>Affects Versions: 0.8.1
>Reporter: Jun Rao
>Assignee: Jun Rao
> Fix For: 0.8.1
>
> Attachments: KAFKA-1288.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.2#6252)


Re: Review Request 18740: Fix KAFKA-1286

2014-03-04 Thread Jay Kreps

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


This is very good. I flagged a number of minor things, but basically this is 
great.


clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java


Hey Guozhong, we aren't logging routine things as info. The plan we 
discussed was trace at the beginning and debug at the end.



clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java


Ditto.



clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java


Is there a reason this is seperate from the other member variables...?



clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java


Could this be simplified to 
  boolean notInBackoff = attempts = 0 || batch.lastAttempt + retryBackoffMs 
<= now

and then add that boolean into the compound expression that wraps ready.add



clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordBatch.java


This should probably be called lastAttempt to mimic the other variable 
attempts.



clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java


If you add TODOs please do make sure to do them :-)



clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java


Let's make this 
 "Got error for topic-partition {}, retrying ({} attempts left). Error: {}:



clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java


We should not log this case as we are going to throw an exception.



clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java


Alternately you can use an array for this where the ith entry in the array 
is the error with id i. This is what we do with the other cases. This way when 
you add a new api it is automatically added to the mapping which can be 
populated automatically by iterating over all elements in the enum.



core/src/main/scala/kafka/log/LogManager.scala


Let's not add to log spam...



core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala


Capitalization.


- Jay Kreps


On March 4, 2014, 7:05 p.m., Guozhang Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18740/
> ---
> 
> (Updated March 4, 2014, 7:05 p.m.)
> 
> 
> Review request for kafka.
> 
> 
> Bugs: KAFKA-1286
> https://issues.apache.org/jira/browse/KAFKA-1286
> 
> 
> Repository: kafka
> 
> 
> Description
> ---
> 
> 1. Fix the metadata-in-progree flag issue.
> 
> 2. Add backoff config for retry.
> 
> 3. Some logging level changes.
> 
> 4. Fix a minor NPE bug in delete-topic-manager.
> 
> 5. Rolling bounce test case.
> 
> 
> Diffs
> -
> 
>   clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java 
> bedd2a989a62b1ed53f006e7e2f8bd1bdc5dfa5b 
>   clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java 
> d8e35e7d0e4cd27aad9a8d4bf14bc97458da9417 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java
>  699027447145837495fb56b41ad9ee5e9cb60240 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordBatch.java
>  c7fbf3c06858a6016878667b68ee29b22b604f7d 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java 
> 794262394133d8e10e52971dccc0082d3aa75047 
>   clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java 
> 21a2592ea7c7f5d4831669196cf4e2d2b4e9bcf5 
>   core/src/main/scala/kafka/controller/KafkaController.scala 
> b58cdcd16ffb62ba5329b8b2776f2bd18440b3a0 
>   core/src/main/scala/kafka/log/LogManager.scala 
> 10062af1e02af5e4238f408ba5b9f98cc226244f 
>   core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala 
> 4b7c544594dba734c8875fce2a289f81d67ba291 
> 
> Diff: https://reviews.apache.org/r/18740/diff/
> 
> 
> Testing
> ---
> 
> integration tests
> 
> 
> Thanks,
> 
> Guozhang Wang
> 
>



Re: [VOTE} Apache Kafka Release 0.8.1 - Candidate 1

2014-03-04 Thread Joe Stein
Thanks for taking care of the open issues.  I am removing 18 JIRAs from the
release notes by filtering out resolved and closed status without a
done/resolved resolution
https://issues.apache.org/jira/issues/?filter=12326760 for the release
notes for RC2 and preparing and going through everything again now.

Any other issues with RC1 let me know will roll them into RC2.  Right now
should be able to get RC2 out for vote tonight. I am going to build
using releaseTarGzAll and sign all artifacts and upload them for vote, so
all Scala versions for the brokers.

On Mon, Mar 3, 2014 at 11:50 PM, Jay Kreps  wrote:

> I fixed a couple of niggling issues with the log cleaner I found testing
> the release. None of these are very major but it would be nice to get these
> in 0.8.1 just to ensure a nice out-of-the-box experience. If someone could
> review:
> https://issues.apache.org/jira/browse/KAFKA-1289
>
> -Jay
>
>
> On Fri, Feb 28, 2014 at 6:26 AM, Joe Stein  wrote:
>
> > This is the first candidate for release of Apache Kafka 0.8.1.
> >
> > Release Notes for the 0.8.1 release
> >
> >
> http://people.apache.org/~joestein/kafka-0.8.1-candidate1/RELEASE_NOTES.html
> >
> > *** Please download, test and vote by Tuesday, March 4th, 6pm PDT
> >
> > Kafka's KEYS file containing PGP keys we use to sign the release:
> > http://svn.apache.org/repos/asf/kafka/KEYS in addition to the md5, sha1
> > and
> > sha2 (SHA256) checksum
> >
> > * Release artifacts to be voted upon (source and binary):
> > http://people.apache.org/~joestein/kafka-0.8.1-candidate1/
> >
> > * Maven artifacts to be voted upon prior to release:
> > https://repository.apache.org/content/groups/staging/
> >
> > * The tag to be voted upon (off the 0.8.1 branch) is the 0.8.1 tag
> >
> >
> https://git-wip-us.apache.org/repos/asf?p=kafka.git;a=tag;h=0c9f03fd7a6cae909c429a25ffb4624a7fe507ff
> >
> > /***
> >  Joe Stein
> >  Founder, Principal Consultant
> >  Big Data Open Source Security LLC
> >  http://www.stealth.ly
> >  Twitter: @allthingshadoop 
> > /
> >
>


Re: Review Request 18740: Fix KAFKA-1286

2014-03-04 Thread Guozhang Wang

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

(Updated March 4, 2014, 11:15 p.m.)


Review request for kafka.


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


Repository: kafka


Description (updated)
---

KAFKA-1286.v2


Add the failure handling test case


KAFKA-1286.v1


KAFKA-1253.v1


Fix K1258


Debug producer block issue on retry


Diffs (updated)
-

  clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java 
bedd2a989a62b1ed53f006e7e2f8bd1bdc5dfa5b 
  clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java 
d8e35e7d0e4cd27aad9a8d4bf14bc97458da9417 
  
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java
 699027447145837495fb56b41ad9ee5e9cb60240 
  
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordBatch.java
 c7fbf3c06858a6016878667b68ee29b22b604f7d 
  clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java 
794262394133d8e10e52971dccc0082d3aa75047 
  clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java 
21a2592ea7c7f5d4831669196cf4e2d2b4e9bcf5 
  clients/src/main/java/org/apache/kafka/common/requests/MetadataRequest.java 
91b9d64aca2255ed3ae1283b2703c7a0f8757a55 
  clients/src/main/java/org/apache/kafka/common/requests/MetadataResponse.java 
73b700602006b881e4be75bb4b6d541e64f291e5 
  clients/src/main/java/org/apache/kafka/common/requests/ProduceResponse.java 
PRE-CREATION 
  core/src/main/scala/kafka/controller/KafkaController.scala 
b58cdcd16ffb62ba5329b8b2776f2bd18440b3a0 
  core/src/main/scala/kafka/log/LogManager.scala 
10062af1e02af5e4238f408ba5b9f98cc226244f 
  core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala 
4b7c544594dba734c8875fce2a289f81d67ba291 

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


Testing
---

integration tests


Thanks,

Guozhang Wang



[jira] [Updated] (KAFKA-1286) Retry Can Block

2014-03-04 Thread Guozhang Wang (JIRA)

 [ 
https://issues.apache.org/jira/browse/KAFKA-1286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Guozhang Wang updated KAFKA-1286:
-

Attachment: KAFKA-1286_2014-03-04_15:14:49.patch

> Retry Can Block 
> 
>
> Key: KAFKA-1286
> URL: https://issues.apache.org/jira/browse/KAFKA-1286
> Project: Kafka
>  Issue Type: Sub-task
>  Components: producer 
>Reporter: Guozhang Wang
> Attachments: KAFKA-1286.patch, KAFKA-1286_2014-03-04_11:04:32.patch, 
> KAFKA-1286_2014-03-04_15:14:49.patch
>
>
> Under the following scenario the retry logic can block
> 1. The last broker's socket closed, sender.handleDisconnect() triggered, put 
> the node as disconnected.
> 2. In the next sender.run(), since the node is disconnected, remove the 
> partition from ready set, and call sender.initConnection(), which will not 
> throw exception.
> 3. So in this round of send, the only request it tries to send to is the 
> metadata request, to the last broker; and the sender will firstly try to 
> connect to that broker.
> 4. In selector.poll(), the finishConnect() call will throw exception, and in 
> handleDisconnects(), inFlight request's batches will be null since it is a 
> metadata request.
> 5. Now we will go back to 1, and loop forever. Note that this infinite loop 
> can be triggered even without calling producer.close.
> Also, we need to introduce the retry backoff config, otherwise the retries 
> will be exhausted too soon (in my tests 10 retries can be exhausted in about 
> 600ms).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Re: Review Request 18740: Fix KAFKA-1286

2014-03-04 Thread Guozhang Wang

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

(Updated March 4, 2014, 11:15 p.m.)


Review request for kafka.


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


Repository: kafka


Description (updated)
---

Incorporated Jay's comments.

1. Fix the metadata-in-progree flag issue.

2. Add backoff config for retry.

3. Some logging level changes.

4. Fix a minor NPE bug in delete-topic-manager.

5. Rolling bounce test case.


Diffs
-

  clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java 
bedd2a989a62b1ed53f006e7e2f8bd1bdc5dfa5b 
  clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java 
d8e35e7d0e4cd27aad9a8d4bf14bc97458da9417 
  
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java
 699027447145837495fb56b41ad9ee5e9cb60240 
  
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordBatch.java
 c7fbf3c06858a6016878667b68ee29b22b604f7d 
  clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java 
794262394133d8e10e52971dccc0082d3aa75047 
  clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java 
21a2592ea7c7f5d4831669196cf4e2d2b4e9bcf5 
  clients/src/main/java/org/apache/kafka/common/requests/MetadataRequest.java 
91b9d64aca2255ed3ae1283b2703c7a0f8757a55 
  clients/src/main/java/org/apache/kafka/common/requests/MetadataResponse.java 
73b700602006b881e4be75bb4b6d541e64f291e5 
  clients/src/main/java/org/apache/kafka/common/requests/ProduceResponse.java 
PRE-CREATION 
  core/src/main/scala/kafka/controller/KafkaController.scala 
b58cdcd16ffb62ba5329b8b2776f2bd18440b3a0 
  core/src/main/scala/kafka/log/LogManager.scala 
10062af1e02af5e4238f408ba5b9f98cc226244f 
  core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala 
4b7c544594dba734c8875fce2a289f81d67ba291 

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


Testing
---

integration tests


Thanks,

Guozhang Wang



[jira] [Commented] (KAFKA-1286) Retry Can Block

2014-03-04 Thread Guozhang Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/KAFKA-1286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13920186#comment-13920186
 ] 

Guozhang Wang commented on KAFKA-1286:
--

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

> Retry Can Block 
> 
>
> Key: KAFKA-1286
> URL: https://issues.apache.org/jira/browse/KAFKA-1286
> Project: Kafka
>  Issue Type: Sub-task
>  Components: producer 
>Reporter: Guozhang Wang
> Attachments: KAFKA-1286.patch, KAFKA-1286_2014-03-04_11:04:32.patch, 
> KAFKA-1286_2014-03-04_15:14:49.patch
>
>
> Under the following scenario the retry logic can block
> 1. The last broker's socket closed, sender.handleDisconnect() triggered, put 
> the node as disconnected.
> 2. In the next sender.run(), since the node is disconnected, remove the 
> partition from ready set, and call sender.initConnection(), which will not 
> throw exception.
> 3. So in this round of send, the only request it tries to send to is the 
> metadata request, to the last broker; and the sender will firstly try to 
> connect to that broker.
> 4. In selector.poll(), the finishConnect() call will throw exception, and in 
> handleDisconnects(), inFlight request's batches will be null since it is a 
> metadata request.
> 5. Now we will go back to 1, and loop forever. Note that this infinite loop 
> can be triggered even without calling producer.close.
> Also, we need to introduce the retry backoff config, otherwise the retries 
> will be exhausted too soon (in my tests 10 retries can be exhausted in about 
> 600ms).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Re: Review Request 18740: Fix KAFKA-1286

2014-03-04 Thread Guozhang Wang


> On March 4, 2014, 9:23 p.m., Jay Kreps wrote:
> > core/src/main/scala/kafka/log/LogManager.scala, line 182
> > 
> >
> > Let's not add to log spam...

I saw for sub-modules we have some inconsistency: for some of them (e.g. 
replica manager) we have info, for some others like log manager we have debug. 
And I personally would argue to have server sub-module starting/shutting down 
to be info since 1) they do not add much to the logs, 2) they are very helpful 
not only in debugging but also in trouble shooting. For some other entries I 
actually agree they are more like spams, probably can file a jira for this in 
0.9 server.


- Guozhang


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


On March 4, 2014, 11:15 p.m., Guozhang Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18740/
> ---
> 
> (Updated March 4, 2014, 11:15 p.m.)
> 
> 
> Review request for kafka.
> 
> 
> Bugs: KAFKA-1286
> https://issues.apache.org/jira/browse/KAFKA-1286
> 
> 
> Repository: kafka
> 
> 
> Description
> ---
> 
> KAFKA-1286.v2
> 
> 
> Add the failure handling test case
> 
> 
> KAFKA-1286.v1
> 
> 
> KAFKA-1253.v1
> 
> 
> Fix K1258
> 
> 
> Debug producer block issue on retry
> 
> 
> Diffs
> -
> 
>   clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java 
> bedd2a989a62b1ed53f006e7e2f8bd1bdc5dfa5b 
>   clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java 
> d8e35e7d0e4cd27aad9a8d4bf14bc97458da9417 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java
>  699027447145837495fb56b41ad9ee5e9cb60240 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordBatch.java
>  c7fbf3c06858a6016878667b68ee29b22b604f7d 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java 
> 794262394133d8e10e52971dccc0082d3aa75047 
>   clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java 
> 21a2592ea7c7f5d4831669196cf4e2d2b4e9bcf5 
>   clients/src/main/java/org/apache/kafka/common/requests/MetadataRequest.java 
> 91b9d64aca2255ed3ae1283b2703c7a0f8757a55 
>   
> clients/src/main/java/org/apache/kafka/common/requests/MetadataResponse.java 
> 73b700602006b881e4be75bb4b6d541e64f291e5 
>   clients/src/main/java/org/apache/kafka/common/requests/ProduceResponse.java 
> PRE-CREATION 
>   core/src/main/scala/kafka/controller/KafkaController.scala 
> b58cdcd16ffb62ba5329b8b2776f2bd18440b3a0 
>   core/src/main/scala/kafka/log/LogManager.scala 
> 10062af1e02af5e4238f408ba5b9f98cc226244f 
>   core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala 
> 4b7c544594dba734c8875fce2a289f81d67ba291 
> 
> Diff: https://reviews.apache.org/r/18740/diff/
> 
> 
> Testing
> ---
> 
> integration tests
> 
> 
> Thanks,
> 
> Guozhang Wang
> 
>



Re: Review Request 18299: Proposed In-place Compression on MemoryRecords

2014-03-04 Thread Guozhang Wang


> On March 2, 2014, 2:15 a.m., Jun Rao wrote:
> > clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java,
> >  lines 155-157
> > 
> >
> > My earlier comment about whether we should close the RecordBatch 
> > immediately after this record is appended, is not due to synchronization. 
> > My concern is that if we don't close this RecordBatch, the next message 
> > could be added as an uncompressed one when it can be added as a compressed 
> > one. Not sure if it's a big concern though.

Got it. Agreed.


> On March 2, 2014, 2:15 a.m., Jun Rao wrote:
> > clients/src/main/java/org/apache/kafka/common/record/MemoryRecords.java, 
> > lines 62-63
> > 
> >
> > What is the TODO item?

What I am trying to declare is that this hand-written logic is dependent on the 
fact that compressed shallow message has key==null. If it is changed in the 
future this logic will break. Probably I should just leave it as normal 
comments?


> On March 2, 2014, 2:15 a.m., Jun Rao wrote:
> > clients/src/main/java/org/apache/kafka/common/record/Record.java, lines 
> > 156-158
> > 
> >
> > ???

Sorry, placeholder function that should be removed..


> On March 2, 2014, 2:15 a.m., Jun Rao wrote:
> > clients/src/test/java/org/apache/kafka/common/record/MemoryRecordsTest.java,
> >  lines 84-85
> > 
> >
> > Line 81 not needed?

Should be removed..


- Guozhang


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


On Feb. 27, 2014, 1:33 a.m., Guozhang Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18299/
> ---
> 
> (Updated Feb. 27, 2014, 1:33 a.m.)
> 
> 
> Review request for kafka.
> 
> 
> Bugs: KAFKA-1253
> https://issues.apache.org/jira/browse/KAFKA-1253
> 
> 
> Repository: kafka
> 
> 
> Description
> ---
> 
> Incorporated Jun's comments.
> 
> TODOs:
> 
> Class loader for Snappy.
> 
> 
> Diffs
> -
> 
>   clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java 
> e4bc97279585818860487a39a93b6481742b91db 
>   clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java 
> d8e35e7d0e4cd27aad9a8d4bf14bc97458da9417 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java
>  ce5cf27efa08b79e501439cf79bc8666054a5429 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordBatch.java
>  eb16f6d236e07b16654623606294a051531b5f58 
>   
> clients/src/main/java/org/apache/kafka/common/record/ByteBufferInputStream.java
>  PRE-CREATION 
>   
> clients/src/main/java/org/apache/kafka/common/record/ByteBufferOutputStream.java
>  PRE-CREATION 
>   clients/src/main/java/org/apache/kafka/common/record/CompressionType.java 
> 906da02d02c03aadd8ab73ed2fc9a1898acb8d72 
>   clients/src/main/java/org/apache/kafka/common/record/MemoryRecords.java 
> 9d8935fa3beeb2a78b109a41ed76fd4374239560 
>   clients/src/main/java/org/apache/kafka/common/record/Record.java 
> f1dc9778502cbdfe982254fb6e25947842622239 
>   clients/src/main/java/org/apache/kafka/common/utils/Utils.java 
> 9c34e7dc82f33df7406cad0e64eb6a896d068dc6 
>   clients/src/test/java/org/apache/kafka/common/record/MemoryRecordsTest.java 
> b0745b528cef929c4273f7e2ac4de1476cfc25ad 
>   clients/src/test/java/org/apache/kafka/common/record/RecordTest.java 
> ae54d67da9907b0a043180c7395a1370b3d0528d 
>   clients/src/test/java/org/apache/kafka/common/utils/CrcTest.java 
> PRE-CREATION 
>   clients/src/test/java/org/apache/kafka/test/TestUtils.java 
> 36cfc0fda742eb501af2c2c0330e3f461cf1f40c 
>   core/src/test/scala/integration/kafka/api/ProducerSendTest.scala 
> 34baa8c6c7a15bb4aa93c286604f0eb7b19cd58e 
> 
> Diff: https://reviews.apache.org/r/18299/diff/
> 
> 
> Testing
> ---
> 
> integration tests
> 
> 
> Thanks,
> 
> Guozhang Wang
> 
>



Re: Review Request 18740: Fix KAFKA-1286

2014-03-04 Thread Jay Kreps

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



clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java


Can this be folded into the if statement below?



clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java


Is this supposed to be here?



clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java


I think this may be incorrect if the apikey enums are ever out of order or 
if we retire a key.

Recommend instead the slightly more verbose:
private static final ApiKey[] codeToType;
static {
 int maxKey = -1;
 for(ApiKeys key: ApiKeys.values())
   maxKey = Math.max(maxKey, key.id);
 codeToType = new ApiKey[maxKey];
 for(ApiKey key: ApiKey.values())
   codeToType[key.id] = key;
}


- Jay Kreps


On March 4, 2014, 11:15 p.m., Guozhang Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18740/
> ---
> 
> (Updated March 4, 2014, 11:15 p.m.)
> 
> 
> Review request for kafka.
> 
> 
> Bugs: KAFKA-1286
> https://issues.apache.org/jira/browse/KAFKA-1286
> 
> 
> Repository: kafka
> 
> 
> Description
> ---
> 
> Incorporated Jay's comments.
> 
> 1. Fix the metadata-in-progree flag issue.
> 
> 2. Add backoff config for retry.
> 
> 3. Some logging level changes.
> 
> 4. Fix a minor NPE bug in delete-topic-manager.
> 
> 5. Rolling bounce test case.
> 
> 
> Diffs
> -
> 
>   clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java 
> bedd2a989a62b1ed53f006e7e2f8bd1bdc5dfa5b 
>   clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java 
> d8e35e7d0e4cd27aad9a8d4bf14bc97458da9417 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java
>  699027447145837495fb56b41ad9ee5e9cb60240 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordBatch.java
>  c7fbf3c06858a6016878667b68ee29b22b604f7d 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java 
> 794262394133d8e10e52971dccc0082d3aa75047 
>   clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java 
> 21a2592ea7c7f5d4831669196cf4e2d2b4e9bcf5 
>   clients/src/main/java/org/apache/kafka/common/requests/MetadataRequest.java 
> 91b9d64aca2255ed3ae1283b2703c7a0f8757a55 
>   
> clients/src/main/java/org/apache/kafka/common/requests/MetadataResponse.java 
> 73b700602006b881e4be75bb4b6d541e64f291e5 
>   clients/src/main/java/org/apache/kafka/common/requests/ProduceResponse.java 
> PRE-CREATION 
>   core/src/main/scala/kafka/controller/KafkaController.scala 
> b58cdcd16ffb62ba5329b8b2776f2bd18440b3a0 
>   core/src/main/scala/kafka/log/LogManager.scala 
> 10062af1e02af5e4238f408ba5b9f98cc226244f 
>   core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala 
> 4b7c544594dba734c8875fce2a289f81d67ba291 
> 
> Diff: https://reviews.apache.org/r/18740/diff/
> 
> 
> Testing
> ---
> 
> integration tests
> 
> 
> Thanks,
> 
> Guozhang Wang
> 
>



Re: Review Request 18740: Fix KAFKA-1286

2014-03-04 Thread Jun Rao

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


There are compilation errors when running unit tests.


clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java


Shouldn't this be moved to line 355?



core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala


Could we compare the content of unique message set?



core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala


Actually, why don't we need to close producer during shutdown?



core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala


The comment seems obsolete.



core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala


Why do we need to sleep here since all requests should have received a 
response now.


- Jun Rao


On March 4, 2014, 11:15 p.m., Guozhang Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18740/
> ---
> 
> (Updated March 4, 2014, 11:15 p.m.)
> 
> 
> Review request for kafka.
> 
> 
> Bugs: KAFKA-1286
> https://issues.apache.org/jira/browse/KAFKA-1286
> 
> 
> Repository: kafka
> 
> 
> Description
> ---
> 
> Incorporated Jay's comments.
> 
> 1. Fix the metadata-in-progree flag issue.
> 
> 2. Add backoff config for retry.
> 
> 3. Some logging level changes.
> 
> 4. Fix a minor NPE bug in delete-topic-manager.
> 
> 5. Rolling bounce test case.
> 
> 
> Diffs
> -
> 
>   clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java 
> bedd2a989a62b1ed53f006e7e2f8bd1bdc5dfa5b 
>   clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java 
> d8e35e7d0e4cd27aad9a8d4bf14bc97458da9417 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java
>  699027447145837495fb56b41ad9ee5e9cb60240 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordBatch.java
>  c7fbf3c06858a6016878667b68ee29b22b604f7d 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java 
> 794262394133d8e10e52971dccc0082d3aa75047 
>   clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java 
> 21a2592ea7c7f5d4831669196cf4e2d2b4e9bcf5 
>   clients/src/main/java/org/apache/kafka/common/requests/MetadataRequest.java 
> 91b9d64aca2255ed3ae1283b2703c7a0f8757a55 
>   
> clients/src/main/java/org/apache/kafka/common/requests/MetadataResponse.java 
> 73b700602006b881e4be75bb4b6d541e64f291e5 
>   clients/src/main/java/org/apache/kafka/common/requests/ProduceResponse.java 
> PRE-CREATION 
>   core/src/main/scala/kafka/controller/KafkaController.scala 
> b58cdcd16ffb62ba5329b8b2776f2bd18440b3a0 
>   core/src/main/scala/kafka/log/LogManager.scala 
> 10062af1e02af5e4238f408ba5b9f98cc226244f 
>   core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala 
> 4b7c544594dba734c8875fce2a289f81d67ba291 
> 
> Diff: https://reviews.apache.org/r/18740/diff/
> 
> 
> Testing
> ---
> 
> integration tests
> 
> 
> Thanks,
> 
> Guozhang Wang
> 
>



[jira] [Created] (KAFKA-1291) Make wrapper shell scripts for important tools

2014-03-04 Thread Jay Kreps (JIRA)
Jay Kreps created KAFKA-1291:


 Summary: Make wrapper shell scripts for important tools
 Key: KAFKA-1291
 URL: https://issues.apache.org/jira/browse/KAFKA-1291
 Project: Kafka
  Issue Type: Improvement
Affects Versions: 0.8.1
Reporter: Jay Kreps
 Fix For: 0.8.2


It is nice to have a proper command for the important tools just to help with 
discoverability. I noticed that mirror maker doesn't have such a wrapper. 
Neither does consumer offset checker. It would be good to do an audit and think 
of any tools that should have a wrapper that don't.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Assigned] (KAFKA-1275) fixes for quickstart documentation

2014-03-04 Thread Jay Kreps (JIRA)

 [ 
https://issues.apache.org/jira/browse/KAFKA-1275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jay Kreps reassigned KAFKA-1275:


Assignee: Jay Kreps

> fixes for quickstart documentation
> --
>
> Key: KAFKA-1275
> URL: https://issues.apache.org/jira/browse/KAFKA-1275
> Project: Kafka
>  Issue Type: Bug
>  Components: website
>Affects Versions: 0.8.1
>Reporter: Evan Zacks
>Assignee: Jay Kreps
>Priority: Minor
>  Labels: documentation
> Fix For: 0.8.1
>
> Attachments: KAFKA-1275-quickstart-doc.patch
>
>
> The quickstart guide refers to commands that no longer exist in the master 
> git branch per changes in KAFKA-554.
> If changes for the documentation to match 0.8.1 are already in development 
> elsewhere, please feel free to discard this issue.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Created] (KAFKA-1292) Command-line tools should print what they do as part of their usage command

2014-03-04 Thread Jay Kreps (JIRA)
Jay Kreps created KAFKA-1292:


 Summary: Command-line tools should print what they do as part of 
their usage command
 Key: KAFKA-1292
 URL: https://issues.apache.org/jira/browse/KAFKA-1292
 Project: Kafka
  Issue Type: Improvement
Reporter: Jay Kreps


It would be nice if you could get an explanation for each tool by running the 
command with no arguments. Something like 
bin/kafka-preferred-replica-election.sh is a little scary so it would be nice 
to have it self-describe:
> bin/kafka-preferred-replica-election.sh
This command attempts to return leadership to the preferred replicas (if they 
are alive) from whomever is currently the leader).
Option  Description
--  ---
--alter Alter the configuration for the topic.
...




--
This message was sent by Atlassian JIRA
(v6.2#6252)


command line tools

2014-03-04 Thread Jay Kreps
I noticed that we have been a little haphazard in which commands get a
top-level script. I think these are nice as they make the available
commands discoverable. Currently, for example, mirror maker doesn't have
one and that is a pretty critical tool.

Here is what we have:
kafka-console-consumer.sh
kafka-console-producer.sh
kafka-consumer-perf-test.sh
kafka-preferred-replica-election.sh
kafka-producer-perf-test.sh
kafka-reassign-partitions.sh
kafka-replay-log-producer.sh
kafka-run-class.sh
kafka-server-start.sh
kafka-server-stop.sh
kafka-simple-consumer-perf-test.sh
kafka-simple-consumer-shell.sh
kafka-topics.sh
zookeeper-server-start.sh
zookeeper-server-stop.sh
zookeeper-shell.sh

What should we add (or remove) from that list?

-Jay


Re: Review Request 18740: Fix KAFKA-1286

2014-03-04 Thread Guozhang Wang


> On March 5, 2014, 12:24 a.m., Jun Rao wrote:
> > core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala,
> >  lines 307-308
> > 
> >
> > Could we compare the content of unique message set?

This would be a bit tricky since toSet does not preserve ordering, in order to 
have one-on-one comparison we need to write some dedup code that preserves 
ordering; on the other hand, since each message sent by producer is unique, it 
is less likely that the counts match but the contents are different. Also the 
ordering of the produced messages are verified in the previous tests. So I 
think it is OK to just verify the numbers.


> On March 5, 2014, 12:24 a.m., Jun Rao wrote:
> > core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala,
> >  lines 323-324
> > 
> >
> > Actually, why don't we need to close producer during shutdown?

Originally with isInterruptible of ShutdownableThread to true, the producer may 
still be waiting for data while we try to shutdown the scheduler; later when I 
change isInterruptible to false, I thought we can close the producer on 
shutdown, but ShutdownableThread do not expose such API. If we want to enforce 
shutting down I can extend it with another onShutdown function, for example. 
But I think this is not that necessary, so I will probably just remove the 
comments.


- Guozhang


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


On March 4, 2014, 11:15 p.m., Guozhang Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18740/
> ---
> 
> (Updated March 4, 2014, 11:15 p.m.)
> 
> 
> Review request for kafka.
> 
> 
> Bugs: KAFKA-1286
> https://issues.apache.org/jira/browse/KAFKA-1286
> 
> 
> Repository: kafka
> 
> 
> Description
> ---
> 
> Incorporated Jay's comments.
> 
> 1. Fix the metadata-in-progree flag issue.
> 
> 2. Add backoff config for retry.
> 
> 3. Some logging level changes.
> 
> 4. Fix a minor NPE bug in delete-topic-manager.
> 
> 5. Rolling bounce test case.
> 
> 
> Diffs
> -
> 
>   clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java 
> bedd2a989a62b1ed53f006e7e2f8bd1bdc5dfa5b 
>   clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java 
> d8e35e7d0e4cd27aad9a8d4bf14bc97458da9417 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java
>  699027447145837495fb56b41ad9ee5e9cb60240 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordBatch.java
>  c7fbf3c06858a6016878667b68ee29b22b604f7d 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java 
> 794262394133d8e10e52971dccc0082d3aa75047 
>   clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java 
> 21a2592ea7c7f5d4831669196cf4e2d2b4e9bcf5 
>   clients/src/main/java/org/apache/kafka/common/requests/MetadataRequest.java 
> 91b9d64aca2255ed3ae1283b2703c7a0f8757a55 
>   
> clients/src/main/java/org/apache/kafka/common/requests/MetadataResponse.java 
> 73b700602006b881e4be75bb4b6d541e64f291e5 
>   clients/src/main/java/org/apache/kafka/common/requests/ProduceResponse.java 
> PRE-CREATION 
>   core/src/main/scala/kafka/controller/KafkaController.scala 
> b58cdcd16ffb62ba5329b8b2776f2bd18440b3a0 
>   core/src/main/scala/kafka/log/LogManager.scala 
> 10062af1e02af5e4238f408ba5b9f98cc226244f 
>   core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala 
> 4b7c544594dba734c8875fce2a289f81d67ba291 
> 
> Diff: https://reviews.apache.org/r/18740/diff/
> 
> 
> Testing
> ---
> 
> integration tests
> 
> 
> Thanks,
> 
> Guozhang Wang
> 
>



Re: Review Request 18740: Fix KAFKA-1286

2014-03-04 Thread Guozhang Wang


> On March 5, 2014, 12:02 a.m., Jay Kreps wrote:
> > clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java, line 42
> > 
> >
> > I think this may be incorrect if the apikey enums are ever out of order 
> > or if we retire a key.
> > 
> > Recommend instead the slightly more verbose:
> > private static final ApiKey[] codeToType;
> > static {
> >  int maxKey = -1;
> >  for(ApiKeys key: ApiKeys.values())
> >maxKey = Math.max(maxKey, key.id);
> >  codeToType = new ApiKey[maxKey];
> >  for(ApiKey key: ApiKey.values())
> >codeToType[key.id] = key;
> > }

Good point. And I think we need to make

codeToType = new ApiKey[maxKey+1];

instead of

codeToType = new ApiKey[maxKey];


- Guozhang


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


On March 4, 2014, 11:15 p.m., Guozhang Wang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18740/
> ---
> 
> (Updated March 4, 2014, 11:15 p.m.)
> 
> 
> Review request for kafka.
> 
> 
> Bugs: KAFKA-1286
> https://issues.apache.org/jira/browse/KAFKA-1286
> 
> 
> Repository: kafka
> 
> 
> Description
> ---
> 
> Incorporated Jay's comments.
> 
> 1. Fix the metadata-in-progree flag issue.
> 
> 2. Add backoff config for retry.
> 
> 3. Some logging level changes.
> 
> 4. Fix a minor NPE bug in delete-topic-manager.
> 
> 5. Rolling bounce test case.
> 
> 
> Diffs
> -
> 
>   clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java 
> bedd2a989a62b1ed53f006e7e2f8bd1bdc5dfa5b 
>   clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java 
> d8e35e7d0e4cd27aad9a8d4bf14bc97458da9417 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java
>  699027447145837495fb56b41ad9ee5e9cb60240 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordBatch.java
>  c7fbf3c06858a6016878667b68ee29b22b604f7d 
>   
> clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java 
> 794262394133d8e10e52971dccc0082d3aa75047 
>   clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java 
> 21a2592ea7c7f5d4831669196cf4e2d2b4e9bcf5 
>   clients/src/main/java/org/apache/kafka/common/requests/MetadataRequest.java 
> 91b9d64aca2255ed3ae1283b2703c7a0f8757a55 
>   
> clients/src/main/java/org/apache/kafka/common/requests/MetadataResponse.java 
> 73b700602006b881e4be75bb4b6d541e64f291e5 
>   clients/src/main/java/org/apache/kafka/common/requests/ProduceResponse.java 
> PRE-CREATION 
>   core/src/main/scala/kafka/controller/KafkaController.scala 
> b58cdcd16ffb62ba5329b8b2776f2bd18440b3a0 
>   core/src/main/scala/kafka/log/LogManager.scala 
> 10062af1e02af5e4238f408ba5b9f98cc226244f 
>   core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala 
> 4b7c544594dba734c8875fce2a289f81d67ba291 
> 
> Diff: https://reviews.apache.org/r/18740/diff/
> 
> 
> Testing
> ---
> 
> integration tests
> 
> 
> Thanks,
> 
> Guozhang Wang
> 
>



[jira] [Updated] (KAFKA-1291) Make wrapper shell scripts for important tools

2014-03-04 Thread Jay Kreps (JIRA)

 [ 
https://issues.apache.org/jira/browse/KAFKA-1291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jay Kreps updated KAFKA-1291:
-

Labels: newbie usability  (was: newbie)

> Make wrapper shell scripts for important tools
> --
>
> Key: KAFKA-1291
> URL: https://issues.apache.org/jira/browse/KAFKA-1291
> Project: Kafka
>  Issue Type: Improvement
>Affects Versions: 0.8.1
>Reporter: Jay Kreps
>  Labels: newbie, usability
> Fix For: 0.8.2
>
>
> It is nice to have a proper command for the important tools just to help with 
> discoverability. I noticed that mirror maker doesn't have such a wrapper. 
> Neither does consumer offset checker. It would be good to do an audit and 
> think of any tools that should have a wrapper that don't.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Usability

2014-03-04 Thread Jay Kreps
Hey guys,

It would be good to tag any JIRA for something which is an confusing or
annoying with the "usability" tag. I am trying to get a list of all these
together so we can take a wack at some of them in a co-ordinated way.

-Jay


Re: Review Request 18740: Fix KAFKA-1286

2014-03-04 Thread Guozhang Wang

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

(Updated March 5, 2014, 1:57 a.m.)


Review request for kafka.


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


Repository: kafka


Description (updated)
---

Incoporated Jun and Jay's comments


KAFKA-1286.v2


Add the failure handling test case


KAFKA-1286.v1


KAFKA-1253.v1


Fix K1258


Debug producer block issue on retry


Diffs (updated)
-

  clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java 
bedd2a989a62b1ed53f006e7e2f8bd1bdc5dfa5b 
  clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java 
d8e35e7d0e4cd27aad9a8d4bf14bc97458da9417 
  
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java
 699027447145837495fb56b41ad9ee5e9cb60240 
  
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordBatch.java
 c7fbf3c06858a6016878667b68ee29b22b604f7d 
  clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java 
794262394133d8e10e52971dccc0082d3aa75047 
  clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java 
21a2592ea7c7f5d4831669196cf4e2d2b4e9bcf5 
  clients/src/main/java/org/apache/kafka/common/requests/MetadataRequest.java 
91b9d64aca2255ed3ae1283b2703c7a0f8757a55 
  clients/src/main/java/org/apache/kafka/common/requests/MetadataResponse.java 
73b700602006b881e4be75bb4b6d541e64f291e5 
  clients/src/main/java/org/apache/kafka/common/requests/ProduceResponse.java 
PRE-CREATION 
  
clients/src/test/java/org/apache/kafka/clients/producer/RecordAccumulatorTest.java
 a3bf07e4ae2daf2c506f4ddff326675dc0de3ee7 
  core/src/main/scala/kafka/controller/KafkaController.scala 
b58cdcd16ffb62ba5329b8b2776f2bd18440b3a0 
  core/src/main/scala/kafka/log/LogManager.scala 
bcd2bb7cb3152f2f6cb99123108fa3a79e393661 
  core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala 
4b7c544594dba734c8875fce2a289f81d67ba291 

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


Testing
---

integration tests


Thanks,

Guozhang Wang



Re: Review Request 18740: Fix KAFKA-1286

2014-03-04 Thread Guozhang Wang

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

(Updated March 5, 2014, 1:58 a.m.)


Review request for kafka.


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


Repository: kafka


Description (updated)
---

Incoporated Jun and Jay's comments

Incorporated Jay's comments.

1. Fix the metadata-in-progree flag issue.

2. Add backoff config for retry.

3. Some logging level changes.

4. Fix a minor NPE bug in delete-topic-manager.

5. Rolling bounce test case.


Diffs
-

  clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java 
bedd2a989a62b1ed53f006e7e2f8bd1bdc5dfa5b 
  clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java 
d8e35e7d0e4cd27aad9a8d4bf14bc97458da9417 
  
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java
 699027447145837495fb56b41ad9ee5e9cb60240 
  
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordBatch.java
 c7fbf3c06858a6016878667b68ee29b22b604f7d 
  clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java 
794262394133d8e10e52971dccc0082d3aa75047 
  clients/src/main/java/org/apache/kafka/common/protocol/ApiKeys.java 
21a2592ea7c7f5d4831669196cf4e2d2b4e9bcf5 
  clients/src/main/java/org/apache/kafka/common/requests/MetadataRequest.java 
91b9d64aca2255ed3ae1283b2703c7a0f8757a55 
  clients/src/main/java/org/apache/kafka/common/requests/MetadataResponse.java 
73b700602006b881e4be75bb4b6d541e64f291e5 
  clients/src/main/java/org/apache/kafka/common/requests/ProduceResponse.java 
PRE-CREATION 
  
clients/src/test/java/org/apache/kafka/clients/producer/RecordAccumulatorTest.java
 a3bf07e4ae2daf2c506f4ddff326675dc0de3ee7 
  core/src/main/scala/kafka/controller/KafkaController.scala 
b58cdcd16ffb62ba5329b8b2776f2bd18440b3a0 
  core/src/main/scala/kafka/log/LogManager.scala 
bcd2bb7cb3152f2f6cb99123108fa3a79e393661 
  core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala 
4b7c544594dba734c8875fce2a289f81d67ba291 

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


Testing
---

integration tests


Thanks,

Guozhang Wang



[jira] [Commented] (KAFKA-1286) Retry Can Block

2014-03-04 Thread Guozhang Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/KAFKA-1286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13920390#comment-13920390
 ] 

Guozhang Wang commented on KAFKA-1286:
--

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

> Retry Can Block 
> 
>
> Key: KAFKA-1286
> URL: https://issues.apache.org/jira/browse/KAFKA-1286
> Project: Kafka
>  Issue Type: Sub-task
>  Components: producer 
>Reporter: Guozhang Wang
> Attachments: KAFKA-1286.patch, KAFKA-1286_2014-03-04_11:04:32.patch, 
> KAFKA-1286_2014-03-04_15:14:49.patch, KAFKA-1286_2014-03-04_17:56:47.patch
>
>
> Under the following scenario the retry logic can block
> 1. The last broker's socket closed, sender.handleDisconnect() triggered, put 
> the node as disconnected.
> 2. In the next sender.run(), since the node is disconnected, remove the 
> partition from ready set, and call sender.initConnection(), which will not 
> throw exception.
> 3. So in this round of send, the only request it tries to send to is the 
> metadata request, to the last broker; and the sender will firstly try to 
> connect to that broker.
> 4. In selector.poll(), the finishConnect() call will throw exception, and in 
> handleDisconnects(), inFlight request's batches will be null since it is a 
> metadata request.
> 5. Now we will go back to 1, and loop forever. Note that this infinite loop 
> can be triggered even without calling producer.close.
> Also, we need to introduce the retry backoff config, otherwise the retries 
> will be exhausted too soon (in my tests 10 retries can be exhausted in about 
> 600ms).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Updated] (KAFKA-1286) Retry Can Block

2014-03-04 Thread Guozhang Wang (JIRA)

 [ 
https://issues.apache.org/jira/browse/KAFKA-1286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Guozhang Wang updated KAFKA-1286:
-

Attachment: KAFKA-1286_2014-03-04_17:56:47.patch

> Retry Can Block 
> 
>
> Key: KAFKA-1286
> URL: https://issues.apache.org/jira/browse/KAFKA-1286
> Project: Kafka
>  Issue Type: Sub-task
>  Components: producer 
>Reporter: Guozhang Wang
> Attachments: KAFKA-1286.patch, KAFKA-1286_2014-03-04_11:04:32.patch, 
> KAFKA-1286_2014-03-04_15:14:49.patch, KAFKA-1286_2014-03-04_17:56:47.patch
>
>
> Under the following scenario the retry logic can block
> 1. The last broker's socket closed, sender.handleDisconnect() triggered, put 
> the node as disconnected.
> 2. In the next sender.run(), since the node is disconnected, remove the 
> partition from ready set, and call sender.initConnection(), which will not 
> throw exception.
> 3. So in this round of send, the only request it tries to send to is the 
> metadata request, to the last broker; and the sender will firstly try to 
> connect to that broker.
> 4. In selector.poll(), the finishConnect() call will throw exception, and in 
> handleDisconnects(), inFlight request's batches will be null since it is a 
> metadata request.
> 5. Now we will go back to 1, and loop forever. Note that this infinite loop 
> can be triggered even without calling producer.close.
> Also, we need to introduce the retry backoff config, otherwise the retries 
> will be exhausted too soon (in my tests 10 retries can be exhausted in about 
> 600ms).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[VOTE CANCELED] Apache Kafka Release 0.8.1 - Candidate 1

2014-03-04 Thread Joe Stein
preparing rc2


On Tue, Mar 4, 2014 at 5:24 PM, Joe Stein  wrote:

> Thanks for taking care of the open issues.  I am removing 18 JIRAs from
> the release notes by filtering out resolved and closed status without a
> done/resolved resolution
> https://issues.apache.org/jira/issues/?filter=12326760 for the release
> notes for RC2 and preparing and going through everything again now.
>
> Any other issues with RC1 let me know will roll them into RC2.  Right now
> should be able to get RC2 out for vote tonight. I am going to build
> using releaseTarGzAll and sign all artifacts and upload them for vote, so
> all Scala versions for the brokers.
>
> On Mon, Mar 3, 2014 at 11:50 PM, Jay Kreps  wrote:
>
>> I fixed a couple of niggling issues with the log cleaner I found testing
>> the release. None of these are very major but it would be nice to get
>> these
>> in 0.8.1 just to ensure a nice out-of-the-box experience. If someone could
>> review:
>> https://issues.apache.org/jira/browse/KAFKA-1289
>>
>> -Jay
>>
>>
>> On Fri, Feb 28, 2014 at 6:26 AM, Joe Stein  wrote:
>>
>> > This is the first candidate for release of Apache Kafka 0.8.1.
>> >
>> > Release Notes for the 0.8.1 release
>> >
>> >
>> http://people.apache.org/~joestein/kafka-0.8.1-candidate1/RELEASE_NOTES.html
>> >
>> > *** Please download, test and vote by Tuesday, March 4th, 6pm PDT
>> >
>> > Kafka's KEYS file containing PGP keys we use to sign the release:
>> > http://svn.apache.org/repos/asf/kafka/KEYS in addition to the md5, sha1
>> > and
>> > sha2 (SHA256) checksum
>> >
>> > * Release artifacts to be voted upon (source and binary):
>> > http://people.apache.org/~joestein/kafka-0.8.1-candidate1/
>> >
>> > * Maven artifacts to be voted upon prior to release:
>> > https://repository.apache.org/content/groups/staging/
>> >
>> > * The tag to be voted upon (off the 0.8.1 branch) is the 0.8.1 tag
>> >
>> >
>> https://git-wip-us.apache.org/repos/asf?p=kafka.git;a=tag;h=0c9f03fd7a6cae909c429a25ffb4624a7fe507ff
>> >
>> > /***
>> >  Joe Stein
>> >  Founder, Principal Consultant
>> >  Big Data Open Source Security LLC
>> >  http://www.stealth.ly
>> >  Twitter: @allthingshadoop 
>> > /
>> >
>>
>
>


wiki for Kafka system tests

2014-03-04 Thread Jun Rao
Hi,

I added a few wiki pages that describe the current system tests in Kafka.
The following is the entry point, which is linked off the main wiki page.

https://cwiki.apache.org/confluence/display/KAFKA/Kafka+System+Tests

Thanks,

Jun


Re: command line tools

2014-03-04 Thread Joe Stein
How about a kafka-system-tool.sh  and a little bash/scala underneath
to delegate which tool is asked for and passes the params from cli to
object?  kafka-system-tool.sh -h would respond with the list of tools and
kafka-system-tool.sh toolName -h would respond with the actual tool's args
from the tool object main output?

- Joestein

On Tue, Mar 4, 2014 at 8:42 PM, Jay Kreps  wrote:

> I noticed that we have been a little haphazard in which commands get a
> top-level script. I think these are nice as they make the available
> commands discoverable. Currently, for example, mirror maker doesn't have
> one and that is a pretty critical tool.
>
> Here is what we have:
> kafka-console-consumer.sh
> kafka-console-producer.sh
> kafka-consumer-perf-test.sh
> kafka-preferred-replica-election.sh
> kafka-producer-perf-test.sh
> kafka-reassign-partitions.sh
> kafka-replay-log-producer.sh
> kafka-run-class.sh
> kafka-server-start.sh
> kafka-server-stop.sh
> kafka-simple-consumer-perf-test.sh
> kafka-simple-consumer-shell.sh
> kafka-topics.sh
> zookeeper-server-start.sh
> zookeeper-server-stop.sh
> zookeeper-shell.sh
>
> What should we add (or remove) from that list?
>
> -Jay
>


Re: command line tools

2014-03-04 Thread Jay Kreps
Personally I don't mind the current approach as it is discoverable and
works with tab completion.

I wouldn't be opposed to replacing kafka-run-class.sh with a generic kafka
script that handles the java and logging options and maintaining a human
friendly mapping for some of the class names so that e.g.
  ./kafka topics --list
  ./kafka console-producer --broker localhost:9092
would work as a short cut for some fully qualified name:
  ./kafka kafka.producer.ConsoleProducer
and
  ./kafka
would print a list of known commands. We would probably need a way to
customize memory settings for each command as we do now, though. We would
need some way to make this typo resistent (e.g. if you type a command wrong
you should get a reasonable error and not some big class not found stack
trace).

-Jay



On Tue, Mar 4, 2014 at 7:45 PM, Joe Stein  wrote:

> How about a kafka-system-tool.sh  and a little bash/scala underneath
> to delegate which tool is asked for and passes the params from cli to
> object?  kafka-system-tool.sh -h would respond with the list of tools and
> kafka-system-tool.sh toolName -h would respond with the actual tool's args
> from the tool object main output?
>
> - Joestein
>
> On Tue, Mar 4, 2014 at 8:42 PM, Jay Kreps  wrote:
>
> > I noticed that we have been a little haphazard in which commands get a
> > top-level script. I think these are nice as they make the available
> > commands discoverable. Currently, for example, mirror maker doesn't have
> > one and that is a pretty critical tool.
> >
> > Here is what we have:
> > kafka-console-consumer.sh
> > kafka-console-producer.sh
> > kafka-consumer-perf-test.sh
> > kafka-preferred-replica-election.sh
> > kafka-producer-perf-test.sh
> > kafka-reassign-partitions.sh
> > kafka-replay-log-producer.sh
> > kafka-run-class.sh
> > kafka-server-start.sh
> > kafka-server-stop.sh
> > kafka-simple-consumer-perf-test.sh
> > kafka-simple-consumer-shell.sh
> > kafka-topics.sh
> > zookeeper-server-start.sh
> > zookeeper-server-stop.sh
> > zookeeper-shell.sh
> >
> > What should we add (or remove) from that list?
> >
> > -Jay
> >
>


[jira] [Commented] (KAFKA-1286) Retry Can Block

2014-03-04 Thread Jay Kreps (JIRA)

[ 
https://issues.apache.org/jira/browse/KAFKA-1286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13920465#comment-13920465
 ] 

Jay Kreps commented on KAFKA-1286:
--

This looks good to me. I got one compilation error due to a missing param in 
SenderTest. I fixed that as I assume it is just a missing file. I also fiddled 
with the logic in RecordAccumulator.ready as I thought it was still a little 
opaque. I checked in with those changes. Can you take a look at both and just 
sanity check that I didn't goof anything and you agree the logic is clearer?

> Retry Can Block 
> 
>
> Key: KAFKA-1286
> URL: https://issues.apache.org/jira/browse/KAFKA-1286
> Project: Kafka
>  Issue Type: Sub-task
>  Components: producer 
>Reporter: Guozhang Wang
> Attachments: KAFKA-1286.patch, KAFKA-1286_2014-03-04_11:04:32.patch, 
> KAFKA-1286_2014-03-04_15:14:49.patch, KAFKA-1286_2014-03-04_17:56:47.patch
>
>
> Under the following scenario the retry logic can block
> 1. The last broker's socket closed, sender.handleDisconnect() triggered, put 
> the node as disconnected.
> 2. In the next sender.run(), since the node is disconnected, remove the 
> partition from ready set, and call sender.initConnection(), which will not 
> throw exception.
> 3. So in this round of send, the only request it tries to send to is the 
> metadata request, to the last broker; and the sender will firstly try to 
> connect to that broker.
> 4. In selector.poll(), the finishConnect() call will throw exception, and in 
> handleDisconnects(), inFlight request's batches will be null since it is a 
> metadata request.
> 5. Now we will go back to 1, and loop forever. Note that this infinite loop 
> can be triggered even without calling producer.close.
> Also, we need to introduce the retry backoff config, otherwise the retries 
> will be exhausted too soon (in my tests 10 retries can be exhausted in about 
> 600ms).



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Error when using console consumer

2014-03-04 Thread Jay Kreps
The console consumer broken windows on the 0.8.1 branch. Going through the
quickstart I notice two issues:

1. Control-C now produces a spurious error message:
[2014-03-04 20:44:38,026] WARN Reconnect due to socket error: null
(kafka.consumer.SimpleConsumer)

2. Somebody has added this useless message in the output:
Consumed 3 messages

I actually see 1. in the server logs as well.

(2) seems clever but unfortunately with this message you actually can't DO
anything with the console producer output like pipe it to another command
because we are printing non-message text to the console. Does anyone know
what the motivation for this is? If you want to count the lines just pipe
it to something like wc. This is unix people!

-Jay


Logging irrelevant things

2014-03-04 Thread Jay Kreps
We have been debating the granularity of logging. Here is an example where
I just wasted a little time. I was testing a three node cluster. I killed
one of the brokers and then I saw this in the other brokers logs:

java.nio.channels.ClosedChannelException
at kafka.network.BlockingChannel.send(BlockingChannel.scala:97)
at kafka.consumer.SimpleConsumer.liftedTree1$1(SimpleConsumer.scala:78)
at
kafka.consumer.SimpleConsumer.kafka$consumer$SimpleConsumer$$sendRequest(SimpleConsumer.scala:68)
at
kafka.consumer.SimpleConsumer$$anonfun$fetch$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(SimpleConsumer.scala:107)
at
kafka.consumer.SimpleConsumer$$anonfun$fetch$1$$anonfun$apply$mcV$sp$1.apply(SimpleConsumer.scala:107)
at
kafka.consumer.SimpleConsumer$$anonfun$fetch$1$$anonfun$apply$mcV$sp$1.apply(SimpleConsumer.scala:107)
at kafka.metrics.KafkaTimer.time(KafkaTimer.scala:33)
at
kafka.consumer.SimpleConsumer$$anonfun$fetch$1.apply$mcV$sp(SimpleConsumer.scala:106)
at
kafka.consumer.SimpleConsumer$$anonfun$fetch$1.apply(SimpleConsumer.scala:106)
at
kafka.consumer.SimpleConsumer$$anonfun$fetch$1.apply(SimpleConsumer.scala:106)
at kafka.metrics.KafkaTimer.time(KafkaTimer.scala:33)
at kafka.consumer.SimpleConsumer.fetch(SimpleConsumer.scala:105)
at
kafka.server.AbstractFetcherThread.processFetchRequest(AbstractFetcherThread.scala:96)
at kafka.server.AbstractFetcherThread.doWork(AbstractFetcherThread.scala:88)
at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:51)
[2014-03-04 21:06:38,957] WARN Reconnect due to socket error: null
(kafka.consumer.SimpleConsumer)
[2014-03-04 21:06:39,021] INFO [ReplicaFetcherManager on broker 2] Removed
fetcher for partitions [my-replicated-topic,0]
(kafka.server.ReplicaFetcherManager)
[2014-03-04 21:06:39,022] INFO [ReplicaFetcherThread-0-1], Shutting down
(kafka.server.ReplicaFetcherThread)
[2014-03-04 21:06:41,556] INFO [ReplicaFetcherThread-0-1], Stopped
 (kafka.server.ReplicaFetcherThread)
[2014-03-04 21:06:41,556] INFO [ReplicaFetcherThread-0-1], Shutdown
completed (kafka.server.ReplicaFetcherThread)

Oh no my other brokers are shutting themselves down! What is going on!

No actually this is just us devs unhelping logging the shutting down of
some internal thread I (the humble user) couldn't possibly know anything
about. When normal people interact with a system like this they really find
it unfriendly and hard to use.

When implementing logging please please put yourself in the shoes of the
person using the system. They actually don't want to see every detail of
your internal code that you might be interested in. They want to see
relevant events that they need to know about.

What I needed to see was just a warning about being unable to communicate
with the other broker. A stack trace isn't helpful. These shutdown messages
aren't helpful.

-Jay


Re: Error when using console consumer

2014-03-04 Thread Jun Rao
Not sure why the message count output was added. However, it goes to
stderr, not stdout.

Thanks,

Jun


On Tue, Mar 4, 2014 at 8:49 PM, Jay Kreps  wrote:

> The console consumer broken windows on the 0.8.1 branch. Going through the
> quickstart I notice two issues:
>
> 1. Control-C now produces a spurious error message:
> [2014-03-04 20:44:38,026] WARN Reconnect due to socket error: null
> (kafka.consumer.SimpleConsumer)
>
> 2. Somebody has added this useless message in the output:
> Consumed 3 messages
>
> I actually see 1. in the server logs as well.
>
> (2) seems clever but unfortunately with this message you actually can't DO
> anything with the console producer output like pipe it to another command
> because we are printing non-message text to the console. Does anyone know
> what the motivation for this is? If you want to count the lines just pipe
> it to something like wc. This is unix people!
>
> -Jay
>


[VOTE] Apache Kafka Release 0.8.1 - Candidate 2

2014-03-04 Thread Joe Stein
This is the second candidate for release of Apache Kafka 0.8.1.

This release candidate fixes the following two JIRA
KAFKA-1288and
KAFKA-1289  and updated
release steps with the gradle changes
https://cwiki.apache.org/confluence/display/KAFKA/Release+Process for build
and verification post build.

Release Notes (updated) for the 0.8.1 release
https://people.apache.org/~joestein/kafka-0.8.1-candidate2/RELEASE_NOTES.html

*** Please download, test and vote by Monday, March 10th, 12pm PT

Kafka's KEYS file containing PGP keys we use to sign the release:
http://svn.apache.org/repos/asf/kafka/KEYS in addition to the md5, sha1 and
sha2 (SHA256) checksum.

* Release artifacts to be voted upon (source and binary):
https://people.apache.org/~joestein/kafka-0.8.1-candidate2/

* Maven artifacts to be voted upon prior to release:
https://repository.apache.org/content/groups/staging/

* The tag to be voted upon (off the 0.8.1 branch) is the 0.8.1 tag
https://git-wip-us.apache.org/repos/asf?p=kafka.git;a=tag;h=62f8aaf74c9d36d1dd49cc7e572a7289206b6414

/***
 Joe Stein
 Founder, Principal Consultant
 Big Data Open Source Security LLC
 http://www.stealth.ly
 Twitter: @allthingshadoop 
/


Re: wiki for Kafka system tests

2014-03-04 Thread Guozhang Wang
Hi Jun,

Some links seem not correct in "Troubleshooting a failing case" and "Test
Case Description" sections.

Guozhang


On Tue, Mar 4, 2014 at 6:51 PM, Jun Rao  wrote:

> Hi,
>
> I added a few wiki pages that describe the current system tests in Kafka.
> The following is the entry point, which is linked off the main wiki page.
>
> https://cwiki.apache.org/confluence/display/KAFKA/Kafka+System+Tests
>
> Thanks,
>
> Jun
>



-- 
-- Guozhang