Uploaded image for project: 'A-MQ Broker'
  1. A-MQ Broker
  2. ENTMQBR-471

[A-MQ7, shared-store] 2 brokers can be started using the same store

    Details

    • Type: Bug
    • Status: Done
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: A-MQ 7.0.0.ER12
    • Fix Version/s: A-MQ 7.0.0.ER16
    • Component/s: None
    • Labels:
    • Target Release:
    • Steps to Reproduce:
      Hide
      • create brokers
        ./artemis create --name broker1 ../data/broker1 
        ./artemis create --name broker2  --port-offset 100 ../data/broker2
        

      modify config so both brokers are using the same store area

      <paging-directory>/data/paging</paging-directory>
      
            <bindings-directory>/data/shared_store/data/bindings</bindings-directory>
      
            <journal-directory>/data/journal</journal-directory>
      
            <large-messages-directory>/data/shared_store/data/large-messages</large-messages-directory>
      

      start broker1 and broker2
      Both should report

       INFO  [org.apache.activemq.artemis.core.server] AMQ221007: Server is now live
      

      send message to broker1

      ./artemis producer --url tcp://localhost:61616
      

      send messages to broker2

      ./artemis producer --url tcp://localhost:61716
      

      shutdown broker1 and broker2

      start just broker1

      Show
      create brokers ./artemis create --name broker1 ../data/broker1 ./artemis create --name broker2 --port-offset 100 ../data/broker2 modify config so both brokers are using the same store area <paging-directory>/data/paging</paging-directory> <bindings-directory>/data/shared_store/data/bindings</bindings-directory> <journal-directory>/data/journal</journal-directory> <large-messages-directory>/data/shared_store/data/large-messages</large-messages-directory> start broker1 and broker2 Both should report INFO [org.apache.activemq.artemis.core.server] AMQ221007: Server is now live send message to broker1 ./artemis producer --url tcp: //localhost:61616 send messages to broker2 ./artemis producer --url tcp: //localhost:61716 shutdown broker1 and broker2 start just broker1
    • Affects:
      Documentation (Ref Guide, User Guide, etc.)
    • Release Notes Docs Status:
      Not Yet Documented

      Description

      with Artemis beta 1, NIO, (tested on a mac) I noticed that if two brokers point to the same data store (but NOT specifying a shared store ha policy - misconfigured the broker) both brokers started with no errors.

      After shutting down both brokers and restarting just one broker, got the following error, which looks like a some corruption in the store.

      11:05:12,080 ERROR [org.apache.activemq.artemis.core.server] AMQ224000: Failure in initialisation: java.lang.IndexOutOfBoundsException: readerIndex(40) + length(135790592) exceeds writerIndex(99): UnpooledHeapByteBuf(ridx: 40, widx: 99, cap: 99/99)
      	at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1177) [netty-all-4.0.37.Final-redhat-2.jar:4.0.37.Final-redhat-2]
      	at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1171) [netty-all-4.0.37.Final-redhat-2.jar:4.0.37.Final-redhat-2]
      	at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:692) [netty-all-4.0.37.Final-redhat-2.jar:4.0.37.Final-redhat-2]
      	at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:700) [netty-all-4.0.37.Final-redhat-2.jar:4.0.37.Final-redhat-2]
      	at io.netty.buffer.WrappedByteBuf.readBytes(WrappedByteBuf.java:518) [netty-all-4.0.37.Final-redhat-2.jar:4.0.37.Final-redhat-2]
      	at org.apache.activemq.artemis.core.buffers.impl.ChannelBufferWrapper.readSimpleStringInternal(ChannelBufferWrapper.java:90) [artemis-commons-1.3.0.amq-700005-redhat-1.jar:1.3.0.amq-700005-redhat-1]
      	at org.apache.activemq.artemis.core.buffers.impl.ChannelBufferWrapper.readSimpleString(ChannelBufferWrapper.java:84) [artemis-commons-1.3.0.amq-700005-redhat-1.jar:1.3.0.amq-700005-redhat-1]
      	at org.apache.activemq.artemis.core.persistence.impl.journal.codec.PersistentQueueBindingEncoding.decode(PersistentQueueBindingEncoding.java:112) [artemis-server-1.3.0.amq-700005-redhat-1.jar:1.3.0.amq-700005-redhat-1]
      	at org.apache.activemq.artemis.core.persistence.impl.journal.AbstractJournalStorageManager.newBindingEncoding(AbstractJournalStorageManager.java:1882) [artemis-server-1.3.0.amq-700005-redhat-1.jar:1.3.0.amq-700005-redhat-1]
      	at org.apache.activemq.artemis.core.persistence.impl.journal.AbstractJournalStorageManager.loadBindingJournal(AbstractJournalStorageManager.java:1389) [artemis-server-1.3.0.amq-700005-redhat-1.jar:1.3.0.amq-700005-redhat-1]
      	at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.loadJournals(ActiveMQServerImpl.java:2134) [artemis-server-1.3.0.amq-700005-redhat-1.jar:1.3.0.amq-700005-redhat-1]
      	at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.initialisePart2(ActiveMQServerImpl.java:2003) [artemis-server-1.3.0.amq-700005-redhat-1.jar:1.3.0.amq-700005-redhat-1]
      	at org.apache.activemq.artemis.core.server.impl.LiveOnlyActivation.run(LiveOnlyActivation.java:63) [artemis-server-1.3.0.amq-700005-redhat-1.jar:1.3.0.amq-700005-redhat-1]
      	at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.start(ActiveMQServerImpl.java:451) [artemis-server-1.3.0.amq-700005-redhat-1.jar:1.3.0.amq-700005-redhat-1]
      	at org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl.start(JMSServerManagerImpl.java:412) [artemis-jms-server-1.3.0.amq-700005-redhat-1.jar:1.3.0.amq-700005-redhat-1]
      	at org.apache.activemq.artemis.integration.FileBroker.start(FileBroker.java:66) [artemis-cli-1.3.0.amq-700005-redhat-1.jar:1.3.0.amq-700005-redhat-1]
      
      

      I would have expected one broker to have a lock on that store and avoid the second misconfigured brokers getting access to the store.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  gaohoward Howard Gao
                  Reporter:
                  pfox Patrick Fox
                  Tester:
                  Petra Svobodova
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: