Return-Path: X-Original-To: apmail-activemq-issues-archive@minotaur.apache.org Delivered-To: apmail-activemq-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5F63718488 for ; Fri, 10 Jul 2015 16:13:07 +0000 (UTC) Received: (qmail 18073 invoked by uid 500); 10 Jul 2015 16:13:05 -0000 Delivered-To: apmail-activemq-issues-archive@activemq.apache.org Received: (qmail 17804 invoked by uid 500); 10 Jul 2015 16:13:05 -0000 Mailing-List: contact issues-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list issues@activemq.apache.org Received: (qmail 17676 invoked by uid 99); 10 Jul 2015 16:13:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jul 2015 16:13:05 +0000 Date: Fri, 10 Jul 2015 16:13:05 +0000 (UTC) From: "Gary Tully (JIRA)" To: issues@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AMQ-5875) Removing a destination when using mKahaDB can cause an IllegalStateException MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMQ-5875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14622532#comment-14622532 ] Gary Tully commented on AMQ-5875: --------------------------------- I think org.apache.activemq.network.DurableConduitBridge#setupStaticDestinations needs to be reworked to query the topic region, I think it should be using its clientid and subname also in the match. > Removing a destination when using mKahaDB can cause an IllegalStateException > ---------------------------------------------------------------------------- > > Key: AMQ-5875 > URL: https://issues.apache.org/jira/browse/AMQ-5875 > Project: ActiveMQ > Issue Type: Bug > Components: Broker > Affects Versions: 5.11.1 > Reporter: Christopher L. Shannon > Assignee: Gary Tully > Fix For: 5.12.0 > > Attachments: MultiKahaDBDeletionTest.java > > > This issue occurs when using multiKahaDB and a wild card destination. The problem is that with a wild card topic, multiple destinations can be attached to the same store. If one of the destinations is deleted and the other destinations are empty, the entire store is deleted. This causes an exception later on if trying to do something like subscribe to a destination that wasn't deleted. I've attached a test case to show this issue. > The problem seems to be that the removeMessageStore method in MultiKahaDBPersistenceAdapter relies on adapter.getDestinations.isEmpty() to determine whether the store is eligible for deleting. Unfortunately, the getDestinations method in KahaDBStore excludes destinations that are empty therefore the method doesn't return any destinations even though there is one still attached to the store so the logic goes ahead and deletes the store. > The stack trace from running against 5.12.0-SNAPSHOT is below: > {noformat} > java.lang.IllegalStateException: PageFile is not loaded > at org.apache.activemq.store.kahadb.disk.page.PageFile.assertLoaded(PageFile.java:811) > at org.apache.activemq.store.kahadb.disk.page.PageFile.tx(PageFile.java:304) > at org.apache.activemq.store.kahadb.KahaDBStore$KahaDBTopicMessageStore.getMessageCount(KahaDBStore.java:866) > at org.apache.activemq.store.ProxyTopicMessageStore.getMessageCount(ProxyTopicMessageStore.java:140) > at org.apache.activemq.store.ProxyTopicMessageStore.getMessageCount(ProxyTopicMessageStore.java:140) > at org.apache.activemq.broker.region.cursors.TopicStorePrefetch.getStoreSize(TopicStorePrefetch.java:97) > at org.apache.activemq.broker.region.cursors.AbstractStoreCursor.resetSize(AbstractStoreCursor.java:73) > at org.apache.activemq.broker.region.cursors.TopicStorePrefetch.(TopicStorePrefetch.java:58) > at org.apache.activemq.broker.region.cursors.StoreDurableSubscriberCursor.add(StoreDurableSubscriberCursor.java:119) > at org.apache.activemq.broker.region.PrefetchSubscription.add(PrefetchSubscription.java:584) > at org.apache.activemq.broker.region.DurableTopicSubscription.add(DurableTopicSubscription.java:113) > at org.apache.activemq.broker.region.Topic.addSubscription(Topic.java:161) > at org.apache.activemq.broker.region.AbstractRegion.addConsumer(AbstractRegion.java:400) > at org.apache.activemq.broker.region.TopicRegion.addConsumer(TopicRegion.java:168) > at org.apache.activemq.broker.region.RegionBroker.addConsumer(RegionBroker.java:427) > at org.apache.activemq.broker.jmx.ManagedRegionBroker.addConsumer(ManagedRegionBroker.java:244) > at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:102) > at org.apache.activemq.advisory.AdvisoryBroker.addConsumer(AdvisoryBroker.java:107) > at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:102) > at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:102) > at org.apache.activemq.broker.MutableBrokerFilter.addConsumer(MutableBrokerFilter.java:107) > at org.apache.activemq.broker.TransportConnection.processAddConsumer(TransportConnection.java:667) > at org.apache.activemq.command.ConsumerInfo.visit(ConsumerInfo.java:348) > at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:334) > at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:188) > at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50) > at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113) > at org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:300) > at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83) > at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:214) > at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:196) > at java.lang.Thread.run(Thread.java:745) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)