Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 43018195EE for ; Tue, 15 Mar 2016 16:15:12 +0000 (UTC) Received: (qmail 5196 invoked by uid 500); 15 Mar 2016 16:15:12 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 5158 invoked by uid 500); 15 Mar 2016 16:15:12 -0000 Mailing-List: contact commits-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 commits@activemq.apache.org Received: (qmail 5149 invoked by uid 99); 15 Mar 2016 16:15:12 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Mar 2016 16:15:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 010B5DFA43; Tue, 15 Mar 2016 16:15:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tabish@apache.org To: commits@activemq.apache.org Message-Id: <6dd0036845354149afa0f71b53cdb31b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: activemq git commit: https://issues.apache.org/jira/browse/AMQ-6203 Date: Tue, 15 Mar 2016 16:15:12 +0000 (UTC) Repository: activemq Updated Branches: refs/heads/master 4e6cbcdc5 -> a9521dceb https://issues.apache.org/jira/browse/AMQ-6203 Expose configuration on the persistence adapter level. Double the test timeout and increase the compaction frequency to account for very slow CI boxes. Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/a9521dce Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/a9521dce Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/a9521dce Branch: refs/heads/master Commit: a9521dcebfb4e469dde7465ff95d8e8f1f050abd Parents: 4e6cbcd Author: Timothy Bish Authored: Tue Mar 15 12:02:40 2016 -0400 Committer: Timothy Bish Committed: Tue Mar 15 12:02:40 2016 -0400 ---------------------------------------------------------------------- .../store/kahadb/KahaDBPersistenceAdapter.java | 33 ++++++++++++++++++++ .../TransactedStoreUsageSuspendResumeTest.java | 5 +-- 2 files changed, 36 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/a9521dce/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/KahaDBPersistenceAdapter.java ---------------------------------------------------------------------- diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/KahaDBPersistenceAdapter.java b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/KahaDBPersistenceAdapter.java index ebe12f3..b6b2ca7 100644 --- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/KahaDBPersistenceAdapter.java +++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/KahaDBPersistenceAdapter.java @@ -636,6 +636,39 @@ public class KahaDBPersistenceAdapter extends LockableServiceSupport implements return letter.isEnableIndexPageCaching(); } + public int getCompactAcksAfterNoGC() { + return letter.getCompactAcksAfterNoGC(); + } + + /** + * Sets the number of GC cycles where no journal logs were removed before an attempt to + * move forward all the acks in the last log that contains them and is otherwise unreferenced. + *

+ * A value of -1 will disable this feature. + * + * @param compactAcksAfterNoGC + * Number of empty GC cycles before we rewrite old ACKS. + */ + public void setCompactAcksAfterNoGC(int compactAcksAfterNoGC) { + this.letter.setCompactAcksAfterNoGC(compactAcksAfterNoGC); + } + + public boolean isCompactAcksIgnoresStoreGrowth() { + return this.letter.isCompactAcksIgnoresStoreGrowth(); + } + + /** + * Configure if Ack compaction will occur regardless of continued growth of the + * journal logs meaning that the store has not run out of space yet. Because the + * compaction operation can be costly this value is defaulted to off and the Ack + * compaction is only done when it seems that the store cannot grow and larger. + * + * @param compactAcksIgnoresStoreGrowth the compactAcksIgnoresStoreGrowth to set + */ + public void setCompactAcksIgnoresStoreGrowth(boolean compactAcksIgnoresStoreGrowth) { + this.letter.setCompactAcksIgnoresStoreGrowth(compactAcksIgnoresStoreGrowth); + } + public KahaDBStore getStore() { return letter; } http://git-wip-us.apache.org/repos/asf/activemq/blob/a9521dce/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/TransactedStoreUsageSuspendResumeTest.java ---------------------------------------------------------------------- diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/TransactedStoreUsageSuspendResumeTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/TransactedStoreUsageSuspendResumeTest.java index f1797cb..20c492c 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/TransactedStoreUsageSuspendResumeTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/TransactedStoreUsageSuspendResumeTest.java @@ -117,6 +117,7 @@ public class TransactedStoreUsageSuspendResumeTest { KahaDBPersistenceAdapter kahaDB = new KahaDBPersistenceAdapter(); kahaDB.setJournalMaxFileLength(256 * 1024); kahaDB.setCleanupInterval(10*1000); + kahaDB.setCompactAcksAfterNoGC(5); broker.setPersistenceAdapter(kahaDB); broker.getSystemUsage().getStoreUsage().setLimit(7*1024*1024); @@ -146,7 +147,7 @@ public class TransactedStoreUsageSuspendResumeTest { } }); sendExecutor.shutdown(); - sendExecutor.awaitTermination(5, TimeUnit.MINUTES); + sendExecutor.awaitTermination(10, TimeUnit.MINUTES); boolean allMessagesReceived = messagesReceivedCountDown.await(5, TimeUnit.MINUTES); if (!allMessagesReceived) { @@ -160,7 +161,7 @@ public class TransactedStoreUsageSuspendResumeTest { assertTrue("Got all messages: " + messagesReceivedCountDown, allMessagesReceived); // give consumers a chance to exit gracefully - TimeUnit.SECONDS.sleep(2); + TimeUnit.SECONDS.sleep(5); } private void sendMessages() throws Exception {