You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Robbie Gemmell (Jira)" <ji...@apache.org> on 2024/07/17 13:25:00 UTC

[jira] [Resolved] (ARTEMIS-4910) Synchronization of HA cluster after modifying divert with transformer failure

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

Robbie Gemmell resolved ARTEMIS-4910.
-------------------------------------
    Fix Version/s: 2.36.0
       Resolution: Fixed

> Synchronization of HA cluster after modifying divert with transformer failure
> -----------------------------------------------------------------------------
>
>                 Key: ARTEMIS-4910
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4910
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker, Clustering, Configuration
>    Affects Versions: 2.35.0
>            Reporter: Kirill Chadakin
>            Assignee: Justin Bertram
>            Priority: Major
>             Fix For: 2.36.0
>
>         Attachments: backup_artemis.log, primary_artemis.log
>
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> Modifying divert with transformer in a high-availability (HA) cluster with Apache Artemis by {{broker.xml}} results in an {{IndexOutOfBoundsException}} error in the backup logs. This error breaks the connection between the primary and backup brokers, initiates a quorum vote, and causes the backup to become active, leading to both brokers operating in parallel.
> h2. Steps to Reproduce the Error
> 1. Create primary broker
> {noformat}
> apache-artemis-2.35.0/bin/artemis.cmd create --host=localhost --default-port=61611 --http-port=8111 --clustered --cluster-user=cls --cluster-password=cls --replicated --name=br11 --user=usr --password=usr --allow-anonymous --no-autotune --no-amqp-acceptor --no-hornetq-acceptor --no-mqtt-acceptor --no-stomp-acceptor br11{noformat}
> 2. Create backup broker
> {noformat}
> apache-artemis-2.35.0/bin/artemis.cmd create --host=localhost --default-port=61612 --http-port=8112 --clustered --cluster-user=cls --cluster-password=cls --replicated --backup --name=br12 --user=usr --password=usr --allow-anonymous --no-autotune --no-amqp-acceptor --no-hornetq-acceptor --no-mqtt-acceptor --no-stomp-acceptor br12{noformat}
> 3. Start brokers
> 4. Add test addresses to primary {{broker.xml}}:
> {code:xml}
> <address name="TEST.IN">
>    <anycast>
>       <queue name="TEST.IN"/>
>    </anycast>
> </address>
> <address name="TEST.OUT">
>    <anycast>
>       <queue name="TEST.OUT"/>
>    </anycast>
> </address>{code}
> 5. Add divert with transformer to primary broker.xml
> {code:xml}
> <diverts>
>    <divert name="TEST-DIVERT">
>       <address>TEST.IN</address>
>       <forwarding-address>TEST.OUT</forwarding-address>
>       <filter string="LABEL='Test'"/>
>       <transformer>
>          <class-name>org.apache.activemq.artemis.core.server.transformer.AddHeadersTransformer</class-name>
>       </transformer>
>    </divert>
> </diverts>{code}
> h2. Result
>  - an {{IndexOutOfBoundsException}} error will appear in the backup logs, e.g.:
> {noformat}
> ERROR [org.apache.activemq.artemis.core.client] AMQ214013: Failed to decode packet
> java.lang.IndexOutOfBoundsException: readerIndex(28) + length(209) exceeds writerIndex(233): PooledUnsafeDirectByteBuf(ridx: 28, widx: 233, cap: 233)
> 	at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1442) ~[netty-buffer-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1428) ~[netty-buffer-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:895) ~[netty-buffer-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:903) ~[netty-buffer-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.buffer.WrappedByteBuf.readBytes(WrappedByteBuf.java:657) ~[netty-buffer-4.1.111.Final.jar:4.1.111.Final]
> 	at org.apache.activemq.artemis.core.buffers.impl.ChannelBufferWrapper.readBytes(ChannelBufferWrapper.java:310) ~[artemis-commons-2.35.0.jar:2.35.0]
> 	at org.apache.activemq.artemis.core.protocol.core.impl.wireformat.ReplicationAddMessage.decodeRest(ReplicationAddMessage.java:113) ~[artemis-server-2.35.0.jar:2.35.0]
> 	at org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.decode(PacketImpl.java:385) ~[artemis-core-client-2.35.0.jar:2.35.0]
> 	at org.apache.activemq.artemis.core.protocol.ServerPacketDecoder.slowPathDecode(ServerPacketDecoder.java:292) ~[artemis-server-2.35.0.jar:2.35.0]
> 	at org.apache.activemq.artemis.core.protocol.ServerPacketDecoder.decode(ServerPacketDecoder.java:156) ~[artemis-server-2.35.0.jar:2.35.0]
> 	at org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:386) [artemis-core-client-2.35.0.jar:2.35.0]
> 	at org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl$DelegatingBufferHandler.bufferReceived(ClientSessionFactoryImpl.java:1365) [artemis-core-client-2.35.0.jar:2.35.0]
> 	at org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQChannelHandler.channelRead(ActiveMQChannelHandler.java:73) [artemis-core-client-2.35.0.jar:2.35.0]
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) [netty-transport-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) [netty-transport-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) [netty-transport-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) [netty-codec-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) [netty-codec-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) [netty-transport-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) [netty-transport-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) [netty-transport-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1407) [netty-transport-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) [netty-transport-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) [netty-transport-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:918) [netty-transport-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) [netty-transport-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) [netty-transport-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) [netty-transport-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) [netty-transport-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) [netty-transport-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994) [netty-common-4.1.111.Final.jar:4.1.111.Final]
> 	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.111.Final.jar:4.1.111.Final]{noformat}
>  - the connection between primary and backup will be broken
>  - a quorum vote will be initiated
>  - the backup will become active and will operate in parallel with the primary



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@activemq.apache.org
For additional commands, e-mail: issues-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact