Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 29519 invoked from network); 19 Jun 2008 16:41:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Jun 2008 16:41:21 -0000 Received: (qmail 47828 invoked by uid 500); 19 Jun 2008 16:41:23 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 47808 invoked by uid 500); 19 Jun 2008 16:41:23 -0000 Mailing-List: contact dev-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 dev@activemq.apache.org Received: (qmail 47797 invoked by uid 99); 19 Jun 2008 16:41:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jun 2008 09:41:23 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jun 2008 16:40:41 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5ED89234C14A for ; Thu, 19 Jun 2008 09:41:00 -0700 (PDT) Message-ID: <745947296.1213893660387.JavaMail.jira@brutus> Date: Thu, 19 Jun 2008 09:41:00 -0700 (PDT) From: "Rob Davies (JIRA)" To: dev@activemq.apache.org Subject: [jira] Resolved: (AMQ-1798) store checkpoint repeatidly writes the same checkpoint record - results in unnecessary writes In-Reply-To: <2098160309.1213355040294.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQ-1798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rob Davies resolved AMQ-1798. ----------------------------- Fix Version/s: 5.2.0 Resolution: Fixed Fixed bu SVN revision 669265 > store checkpoint repeatidly writes the same checkpoint record - results in unnecessary writes > --------------------------------------------------------------------------------------------- > > Key: AMQ-1798 > URL: https://issues.apache.org/activemq/browse/AMQ-1798 > Project: ActiveMQ > Issue Type: Improvement > Components: Message Store > Affects Versions: 5.1.0 > Environment: all - default config > Reporter: Gary Tully > Assignee: Rob Davies > Priority: Minor > Fix For: 5.2.0 > > > I left a simple test running over night to find that the data file index was incrementing, it turns out that the checkpoint functionality does not remember its last mark and will always write a mark, even if it is the same as the last written mark, with a small dataFileSize I found that the current data file index was not as expected. > This is really just odd behaviour rather than bug as I don't think it has any really adverse effects unless there is a cap on the file id. (which there is not!) > the following change ensures that checkpoint will only write a record if there is a change to the last recorded mark. > Index: src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java > =================================================================== > --- src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java (revision 667120) > +++ src/main/java/org/apache/activemq/store/amq/AMQPersistenceAdapter.java (working copy) > @@ -375,12 +375,13 @@ > LOG.debug("Checkpoint started."); > } > > - Location newMark = null; > + Location currentMark = asyncDataManager.getMark(); > + Location newMark = currentMark; > Iterator queueIterator = queues.values().iterator(); > while (queueIterator.hasNext()) { > final AMQMessageStore ms = queueIterator.next(); > Location mark = (Location)ms.getMark(); > - if (mark != null && (newMark == null || newMark.compareTo(mark) < 0)) { > + if (mark != null && mark.compareTo(newMark) > 0) { > newMark = mark; > } > } > @@ -388,12 +389,12 @@ > while (topicIterator.hasNext()) { > final AMQTopicMessageStore ms = topicIterator.next(); > Location mark = (Location)ms.getMark(); > - if (mark != null && (newMark == null || newMark.compareTo(mark) < 0)) { > + if (mark != null && mark.compareTo(newMark) > 0) { > newMark = mark; > } > } > try { > - if (newMark != null) { > + if (newMark != currentMark) { > if (LOG.isDebugEnabled()) { > LOG.debug("Marking journal at: " + newMark); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.