Skip to content

When the content of the sent message is 5M, it will appear that the current Topic can no longer send the message #7115

Description

@liudezhi2098

Describe the bug
By default config , when the content of the sent message is 5M, it will appear that the current topic can no longer send the message.

Send a message

byte[] data = new byte[5 * 1024 * 1024];
producer.newMessage().value(data).send();

bookie has always been wrong io.netty.handler.codec.TooLongFrameException: Adjusted frame length exceeds 5242880: 5242992 - discarded

bookie-io-1-26] ERROR org.apache.bookkeeper.proto.BookieRequestHandler - Unhandled exception occurred in I/O thread or handler
io.netty.handler.codec.TooLongFrameException: Adjusted frame length exceeds 5242880: 5242992 - discarded
        at io.netty.handler.codec.LengthFieldBasedFrameDecoder.fail(LengthFieldBasedFrameDecoder.java:513) ~[io.netty-netty-codec-4.1.43.Final.jar:4.1.43.Final]
        at io.netty.handler.codec.LengthFieldBasedFrameDecoder.failIfNecessary(LengthFieldBasedFrameDecoder.java:491) ~[io.netty-netty-codec-4.1.43.Final.jar:4.1.43.Final]
        at io.netty.handler.codec.LengthFieldBasedFrameDecoder.exceededFrameLength(LengthFieldBasedFrameDecoder.java:378) ~[io.netty-netty-codec-4.1.43.Final.jar:4.1.43.Final]
        at io.netty.handler.codec.LengthFieldBasedFrameDecoder.decode(LengthFieldBasedFrameDecoder.java:421) ~[io.netty-netty-codec-4.1.43.Final.jar:4.1.43.Final]
        at io.netty.handler.codec.LengthFieldBasedFrameDecoder.decode(LengthFieldBasedFrameDecoder.java:334) ~[io.netty-netty-codec-4.1.43.Final.jar:4.1.43.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:503) ~[io.netty-netty-codec-4.1.43.Final.jar:4.1.43.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:442) ~[io.netty-netty-codec-4.1.43.Final.jar:4.1.43.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:281) ~[io.netty-netty-codec-4.1.43.Final.jar:4.1.43.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [io.netty-netty-transport-4.1.43.Final.jar:4.1.43.Final]

Bookie default configuration nettyMaxFrameSizeBytes is 5242880
but broker set NettyMaxFrameSizeBytes (conf.getMaxMessageSize() Commands.MESSAGE_SIZE_FRAME_PADDING);

bk_server.conf
# The maximum netty frame size in bytes. Any message received larger than this will be rejeted. Default value is 5MB.
# nettyMaxFrameSizeBytes=5242880

broker.conf
# Max size of messages.
maxMessageSize=5242880

So the broker thinks that the 5M message can be sent normally, but the bookie thinks it has exceeded the length, and bkclient will keep retrying.

Metadata

Metadata

Assignees

Labels

type/bugThe PR fixed a bug or issue reported a bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions