apache / apache/pulsar

IllegalStateException: Field 'read_compacted' is not set

Open
#11,286 4 comments 0 reactions 0 assignees View on GitHub
lifecycle/stale type/bug
Dominant language
Java
Stars
15.3k
Forks
3.8k
Avg merge
1d 14h
Merged PRs (30d)
160

Description

**Describe the bug**
Hello, I got the following error fro Pulsar 2.8.0 (binaries downloaded from the website):

```
14:04:09.671 [pulsar-io-29-11] INFO org.apache.pulsar.broker.service.ServerCnx - New connection from /127.0.0.1:33960
14:04:09.675 [pulsar-io-29-12] INFO org.apache.pulsar.broker.service.ServerCnx - New connection from /127.0.0.1:33962
14:04:09.677 [pulsar-io-29-12] WARN org.apache.pulsar.broker.service.ServerCnx - [/127.0.0.1:33962] Got exception java.lang.IllegalStateException: Field 'read_compacted' is not set
at org.apache.pulsar.common.api.proto.CommandSubscribe.isReadCompacted(CommandSubscribe.java:383)
at org.apache.pulsar.broker.service.ServerCnx.handleSubscribe(ServerCnx.java:915)
at org.apache.pulsar.common.protocol.PulsarDecoder.channelRead(PulsarDecoder.java:227)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.flow.FlowControlHandler.dequeue(FlowControlHandler.java:200)
at io.netty.handler.flow.FlowControlHandler.channelRead(FlowControlHandler.java:162)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:795)
at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:480)
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)

14:04:09.677 [pulsar-io-29-12] INFO org.apache.pulsar.broker.service.ServerCnx - Closed connection from /127.0.0.1:33962
14:04:09.677 [pulsar-io-29-11] INFO org.apache.pulsar.broker.service.ServerCnx - Closed connection from /127.0.0.1:33960
```

But `read_compacted` is still marked as an optional field in the binary protocol: https://github.com/apache/pulsar/blob/6704f12104219611164aa2bb5bbdfc929613f1bf/pulsar-common/src/main/proto/PulsarApi.proto#L355

**To Reproduce**
1. Download 2.8.0 binaries from https://pulsar.apache.org/en/download/
2. start with `pulsar standalone`
3. install https://github.com/vmalloc/pulsar-cli
4. run with `pulsar-cli consume --topic test --json`

**Expected behavior**
If I trust the protobuf definition the consumer should be created properly. Should the Protobuf file be updated?

Contributor guide

Open the contributing guide

Research direction

Start with PulsarApi.proto at the read_compacted field and trace CommandSubscribe.isReadCompacted into ServerCnx.handleSubscribe. Reproduce with Pulsar 2.8.0 standalone and pulsar-cli consume --topic test --json, then compare the protocol definition and subscription handling. Done means the consumer is created without the reported IllegalStateException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.