From 0061f6f75538ede8fe3443925e64beb839abfb90 Mon Sep 17 00:00:00 2001 From: Gary Tully Date: Wed, 7 Aug 2013 13:38:53 +0000 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-4000 - tracking subscription commands causes a problem with replay outside of activate - can reset a sub ack locations - regression in AMQ2149Test. Fixed by ignoring sub add during recovery replay git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1511306 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/activemq/store/kahadb/MessageDatabase.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java index ffbc454040..1cce8a761d 100644 --- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java +++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java @@ -1014,6 +1014,14 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe */ void process(JournalCommand data, final Location location, final Location inDoubtlocation) throws IOException { if (inDoubtlocation != null && location.compareTo(inDoubtlocation) >= 0) { + if (data instanceof KahaSubscriptionCommand) { + KahaSubscriptionCommand kahaSubscriptionCommand = (KahaSubscriptionCommand)data; + if (kahaSubscriptionCommand.hasSubscriptionInfo()) { + // needs to be processed via activate and will be replayed on reconnect + LOG.debug("ignoring add sub command during recovery replay:" + data); + return; + } + } process(data, location, (Runnable) null, (Runnable) null); } else { // just recover producer audit