panic: kafka: response did not contain all the expected topic/partition blocks
gertcuykens opened this issue · comments
https://github.com/gertcuykens/jocko/blob/master/examples/sarama/main.go
Run server seperatly
% make run
rm -rf /tmp/jocko/*
jocko broker \
--debug \
--log-dir="/tmp/jocko" \
--broker-addr=127.0.0.1:9092 \
--raft-addr=127.0.0.1:9093 \
--serf-addr=127.0.0.1:9094 \
--http-addr=127.0.0.1:9095 \
--id=1
2017/11/05 03:08:35 [INFO] serf: EventMemberJoin: jocko-001 127.0.0.1
2017-11-05 03:08:35 [INFO] jocko: adding peer: &{ID:1 Port:9092 IP:127.0.0.1 SerfPort:0 RaftPort:9093 Status:1 conn:<nil>}
2017/11/05 03:08:35 [INFO] raft: Node at 127.0.0.1:9093 [Leader] entering Leader state
2017-11-05 03:08:35 [INFO] jocko: cluster leadership acquired
2017/11/05 03:08:35 [DEBUG] raft: Node 127.0.0.1:9093 updated peer set (2): [127.0.0.1:9093]
go run main.go multiple times until panic: kafka: response did not contain all the expected topic/partition blocks
% go run main.go
Hello from Jocko #1! 0
msg partition [3] offset [0]
2017/11/05 03:03:24 msg is ok! partition: 3, offset: 0
i: 1, len: 2
still checking partition: 3
Hello from Jocko #12! 1
msg partition [3] offset [1]
2017/11/05 03:03:24 msg is ok! partition: 3, offset: 1
i: 2, len: 2
checked partition: 3
Hello from Jocko #2! 0
msg partition [0] offset [0]
2017/11/05 03:03:24 msg is ok! partition: 0, offset: 0
i: 1, len: 3
still checking partition: 0
Hello from Jocko #7! 1
msg partition [0] offset [1]
2017/11/05 03:03:24 msg is ok! partition: 0, offset: 1
i: 2, len: 3
still checking partition: 0
Hello from Jocko #13! 2
msg partition [0] offset [2]
2017/11/05 03:03:24 msg is ok! partition: 0, offset: 2
i: 3, len: 3
checked partition: 0
Hello from Jocko #3! 0
msg partition [1] offset [0]
2017/11/05 03:03:24 msg is ok! partition: 1, offset: 0
i: 1, len: 1
checked partition: 1
Hello from Jocko #5! 0
msg partition [5] offset [0]
2017/11/05 03:03:24 msg is ok! partition: 5, offset: 0
i: 1, len: 3
still checking partition: 5
Hello from Jocko #10! 1
msg partition [5] offset [1]
2017/11/05 03:03:24 msg is ok! partition: 5, offset: 1
i: 2, len: 3
still checking partition: 5
Hello from Jocko #14! 2
msg partition [5] offset [2]
2017/11/05 03:03:24 msg is ok! partition: 5, offset: 2
i: 3, len: 3
checked partition: 5
Hello from Jocko #9! 0
msg partition [2] offset [0]
2017/11/05 03:03:24 msg is ok! partition: 2, offset: 0
i: 1, len: 2
still checking partition: 2
Hello from Jocko #11! 1
msg partition [2] offset [1]
2017/11/05 03:03:24 msg is ok! partition: 2, offset: 1
i: 2, len: 2
checked partition: 2
Hello from Jocko #0! 0
msg partition [4] offset [0]
2017/11/05 03:03:24 msg is ok! partition: 4, offset: 0
i: 1, len: 4
still checking partition: 4
Hello from Jocko #4! 1
msg partition [4] offset [1]
2017/11/05 03:03:24 msg is ok! partition: 4, offset: 1
i: 2, len: 4
still checking partition: 4
Hello from Jocko #6! 2
msg partition [4] offset [2]
2017/11/05 03:03:24 msg is ok! partition: 4, offset: 2
i: 3, len: 4
still checking partition: 4
Hello from Jocko #8! 3
msg partition [4] offset [3]
2017/11/05 03:03:24 msg is ok! partition: 4, offset: 3
i: 4, len: 4
checked partition: 4
producer and consumer worked! 15 messages ok
% go run main.go
Hello from Jocko #3! 0
msg partition [1] offset [0]
2017/11/05 03:03:47 msg value not equal! partition 1, offset: 0!
exit status 1
% go run main.go
Hello from Jocko #3! 0
msg partition [1] offset [0]
2017/11/05 03:04:02 msg value not equal! partition 1, offset: 0!
exit status 1
% go run main.go
Hello from Jocko #0! 0
msg partition [4] offset [0]
2017/11/05 03:04:36 msg value not equal! partition 4, offset: 0!
exit status 1
% go run main.go
Hello from Jocko #2! 0
msg partition [0] offset [0]
2017/11/05 03:04:39 msg value not equal! partition 0, offset: 0!
exit status 1
% go run main.go
panic: kafka: response did not contain all the expected topic/partition blocks
goroutine 1 [running]:
main.main()
/Users/gert/go/src/github.com/travisjeffery/jocko/examples/sarama/main.go:56 +0x1064
exit status 2
% go run main.go
server
2017-11-05 03:04:42 [DEBUG] jocko: request: correlation id [4], client id [sarama], request size [104], key [0]
2017-11-05 03:04:42 [INFO] jocko: commitlog/append failed: none
2017-11-05 03:04:42 [DEBUG] jocko: response: correlation id [4], key [0]
2017-11-05 03:04:50 [DEBUG] jocko: request: correlation id [1298498081], client id [cmd/createtopic], request size [59], key [19]
2017-11-05 03:04:50 [DEBUG] jocko: response: correlation id [1298498081], key [19]
2017-11-05 03:04:50 [DEBUG] jocko: request: correlation id [0], client id [sarama], request size [20], key [3]
2017-11-05 03:04:50 [DEBUG] jocko: response: correlation id [0], key [3]
2017-11-05 03:04:50 [DEBUG] jocko: request: correlation id [0], client id [sarama], request size [104], key [0]
2017-11-05 03:04:50 [DEBUG] jocko: response: correlation id [0], key [0]
2017-11-05 03:04:50 [DEBUG] jocko: request: correlation id [1], client id [sarama], request size [104], key [0]
2017-11-05 03:04:50 [DEBUG] jocko: response: correlation id [1], key [0]
2017-11-05 03:04:50 [DEBUG] jocko: request: correlation id [2], client id [sarama], request size [104], key [0]
2017-11-05 03:04:50 [DEBUG] jocko: response: correlation id [2], key [0]
2017-11-05 03:04:50 [DEBUG] jocko: request: correlation id [3], client id [sarama], request size [104], key [0]
2017-11-05 03:04:50 [INFO] jocko: commitlog/append failed: none
2017-11-05 03:04:50 [DEBUG] jocko: response: correlation id [3], key [0]
never mind forgot to comment out os.RemoveAll(logDir)
@gertcuykens cool, thanks for double checking