Skip to content

AutoRecovery tried to replicate entry larger than nettyMaxFrameSizeBytes #3521

Closed

Description

@gaozhangmin

maxMessageSize=10485760
nettyMaxFrameSizeBytes=15728640

The above configurations is related to max messages size on broker and bookkeeper side.
entry size is expected to be smaller than 10MB, because any entry larger than 10MB would be rejected on broker side. But during AutoRecovery, it throws below exception, caused write entry failed.

2022-10-03 12:17:19.961 [bookie-io-1-95] ERROR org.apache.bookkeeper.proto.BookieRequestHandler - Unhandled exception occurred in I/O thread or handler on [id: 0x8138791c, L:/x.x.x.x:3181 - R:/x.x.x.x:57664]
io.netty.handler.codec.TooLongFrameException: Adjusted frame length exceeds 15728640: 1195854718 - discarded
        at io.netty.handler.codec.LengthFieldBasedFrameDecoder.fail(LengthFieldBasedFrameDecoder.java:507) ~[io.netty-netty-codec-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.handler.codec.LengthFieldBasedFrameDecoder.failIfNecessary(LengthFieldBasedFrameDecoder.java:493) ~[io.netty-netty-codec-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.handler.codec.LengthFieldBasedFrameDecoder.exceededFrameLength(LengthFieldBasedFrameDecoder.java:377) ~[io.netty-netty-codec-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.handler.codec.LengthFieldBasedFrameDecoder.decode(LengthFieldBasedFrameDecoder.java:423) ~[io.netty-netty-codec-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.handler.codec.LengthFieldBasedFrameDecoder.decode(LengthFieldBasedFrameDecoder.java:333) ~[io.netty-netty-codec-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:510) ~[io.netty-netty-codec-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:449) ~[io.netty-netty-codec-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:279) ~[io.netty-netty-codec-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) [io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) [io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800) [io.netty-netty-transport-classes-epoll-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:487) [io.netty-netty-transport-classes-epoll-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:385) [io.netty-netty-transport-classes-epoll-4.1.77.Final.jar:4.1.77.Final]

Activity

  1. dlg99 commented on Oct 17, 2022

    @dlg99
    Contributor

    is it possible that maxMessageSize/nettyMaxFrameSizeBytes were set to larger values a while ago thus allowing write of such large entry?

  2. gaozhangmin commented on Oct 17, 2022

    @gaozhangmin
    ContributorAuthor

    is it possible that maxMessageSize/nettyMaxFrameSizeBytes were set to larger values a while ago thus allowing write of such large entry?

    @dlg99 it's impossible.

  3. dlg99 commented on Oct 17, 2022

    @dlg99
    Contributor

    So far I found this: netty/netty#10098

    Another possibility is we are reading into a ByteBuf that was returned to recycler and picked from it for the channelRead, but original owner kept a reference on it and changed the content. I don't see where it can happen yet.
    Are you running an OSS release or a private build with cherry-picked changes (i assume this is the case)? any recent changes there that may help narrow the problem down?

  4. horizonzy commented on Oct 18, 2022

    @horizonzy
    Member

    The exception indicates that there is a large body write request in the bookie server, maybe there is an unknown bug at the AutoRecover client, it combines a large write request to send to the bookie server, then the bookie server wants to decode the request body, it over the nettyMaxFrameSizeBytes, so throw an exception.

    Is it easy to reproduce? If so, we can use TCP dump to dump the network package, then analyze the request, and why it is so large.

  5. gaozhangmin commented on Oct 19, 2022

    @gaozhangmin
    ContributorAuthor

    Next time it occurred , i will dump the heap memory of ar client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions