[ 
https://issues.apache.org/jira/browse/ARTEMIS-761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15556447#comment-15556447
 ] 

ASF GitHub Bot commented on ARTEMIS-761:
----------------------------------------

Github user clebertsuconic commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/826#discussion_r82480956
  
    --- Diff: 
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/journal/DuplicateRecordIdTest.java
 ---
    @@ -0,0 +1,54 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements. See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License. You may obtain a copy of the License at
    + * <br>
    + * http://www.apache.org/licenses/LICENSE-2.0
    + * <br>
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.activemq.artemis.tests.integration.journal;
    +
    +import org.apache.activemq.artemis.api.core.SimpleString;
    +import 
org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
    +import org.apache.activemq.artemis.api.core.management.AddressSettingsInfo;
    +import org.apache.activemq.artemis.cli.commands.tools.PrintData;
    +import org.apache.activemq.artemis.core.server.ActiveMQServer;
    +import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
    +import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
    +import org.junit.Before;
    +import org.junit.Test;
    +
    +public class DuplicateRecordIdTest extends ActiveMQTestBase {
    +
    +   protected ActiveMQServer server;
    +
    +   @Override
    +   @Before
    +   public void setUp() throws Exception {
    +      super.setUp();
    +      server = createServer(false, 
createDefaultInVMConfig().addAddressesSetting("#", new 
AddressSettings().setDeadLetterAddress(new 
SimpleString("dlq")).setExpiryAddress(new SimpleString("dlq"))));
    +      server.getConfiguration().setPersistenceEnabled(true);
    +   }
    +
    +   @Test
    +   public void testDuplicateRecordId() throws Exception {
    +      for (int i = 0; i < 3; i++) {
    +         server.start();
    +         ActiveMQServerControl serverControl = 
server.getActiveMQServerControl();
    +         serverControl.removeAddressSettings("q");
    +         AddressSettingsInfo defaultSettings = 
AddressSettingsInfo.from(serverControl.getAddressSettingsAsJSON("#"));
    +         serverControl.addAddressSettings("q", "dlq", 
defaultSettings.getExpiryAddress(), -1, false, 1, 
defaultSettings.getMaxSizeBytes(), defaultSettings.getPageSizeBytes(), 
defaultSettings.getPageCacheMaxSize(), defaultSettings.getRedeliveryDelay(), 
defaultSettings.getRedeliveryMultiplier(), 
defaultSettings.getMaxRedeliveryDelay(), 
defaultSettings.getRedistributionDelay(), 
defaultSettings.isSendToDLAOnNoRoute(), 
defaultSettings.getAddressFullMessagePolicy(), 
defaultSettings.getSlowConsumerThreshold(), 
defaultSettings.getSlowConsumerCheckPeriod(), 
defaultSettings.getSlowConsumerPolicy(), 
defaultSettings.isAutoCreateJmsQueues(), 
defaultSettings.isAutoDeleteJmsQueues(), 
defaultSettings.isAutoCreateJmsTopics(), 
defaultSettings.isAutoDeleteJmsTopics());
    +         server.stop();
    +         
PrintData.printData(server.getConfiguration().getBindingsLocation().getAbsoluteFile(),
 server.getConfiguration().getJournalLocation().getAbsoluteFile(), 
server.getConfiguration().getPagingLocation().getAbsoluteFile());
    --- End diff --
    
    I would remove the PrintData here.. this is for debug purposes only.. and 
anyone can call print-data directly if needed.


> Caused by: java.lang.IllegalStateException: Cannot find add info 2148856738
> ---------------------------------------------------------------------------
>
>                 Key: ARTEMIS-761
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-761
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 1.4.0
>         Environment: Linux and Windows
>            Reporter: Damien Hollis
>            Assignee: Justin Bertram
>             Fix For: 1.5.0
>
>         Attachments: EmbeddedExample.java
>
>
> I added a comment on https://issues.apache.org/jira/browse/ARTEMIS-390 but 
> you may not have seen it as it is closed.  
> From time to time we get an issue when starting up Artemis (embedded in a web 
> application). However, on restarting the server, the problem disappears.
> {noformat}
> Caused by: java.lang.IllegalStateException: Cannot find add info 2148856738
>         at 
> org.apache.activemq.artemis.core.journal.impl.JournalImpl.appendDeleteRecord(JournalImpl.java:793)
>         at 
> org.apache.activemq.artemis.core.journal.impl.JournalBase.appendDeleteRecord(JournalBase.java:206)
>         at 
> org.apache.activemq.artemis.core.journal.impl.JournalImpl.appendDeleteRecord(JournalImpl.java:79)
>         at 
> org.apache.activemq.artemis.core.persistence.impl.journal.AbstractJournalStorageManager.deleteAddressSetting(AbstractJournalStorageManager.java:826)
>         at 
> org.apache.activemq.artemis.core.management.impl.ActiveMQServerControlImpl.removeAddressSettings(ActiveMQServerControlImpl.java:1756)
> {noformat}
> We also had a similar problem when we upgraded from Artemis 1.3.0 to 1.4.0 
> but in that case our only option was to delete the data directories - luckily 
> we were just testing and this was not a big issue for us but it would be in 
> production.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to