Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 7698 invoked from network); 21 Oct 2008 00:35:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Oct 2008 00:35:05 -0000 Received: (qmail 18110 invoked by uid 500); 21 Oct 2008 00:35:07 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 18080 invoked by uid 500); 21 Oct 2008 00:35:07 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 18069 invoked by uid 99); 21 Oct 2008 00:35:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Oct 2008 17:35:07 -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; Tue, 21 Oct 2008 00:34:05 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 40199234C220 for ; Mon, 20 Oct 2008 17:34:44 -0700 (PDT) Message-ID: <1466544472.1224549284261.JavaMail.jira@brutus> Date: Mon, 20 Oct 2008 17:34:44 -0700 (PDT) From: "Jukka Zitting (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Reopened: (JCR-1813) Invalid journal records during XATransactions In-Reply-To: <1294481579.1224077744393.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/jira/browse/JCR-1813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jukka Zitting reopened JCR-1813: -------------------------------- Hmm, you're right. I was just thinking about the original use case where a distributed transaction that has no Jackrabbit changes is committed. Reopening this issue so I remember to look at it more before releasing 1.5.0. I guess it would be a good to set up a clustered test case for the following code: Session session = repository.login(...); try { session.save(); } finally { session.logout(); } This should at least not cause cluster nodes to fail. It would be nice if it also didn't result in any journal entries. > Invalid journal records during XATransactions > --------------------------------------------- > > Key: JCR-1813 > URL: https://issues.apache.org/jira/browse/JCR-1813 > Project: Jackrabbit > Issue Type: Bug > Components: clustering, jackrabbit-core > Reporter: Stephane Landelle > Assignee: Jukka Zitting > Priority: Critical > Fix For: 1.5.0 > > > During the prepare phase of a XATransaction, XAItemStateManager.prepare calls ShareItemStageManager.beginUpdate that, in case of a ClusterNode, calls ClusterNode.updatePrepared that does a ChangeLogRecord.write(). > This last method is located in ClusterRecord and systematically write the begin and the end of the journal record. > As a consequence, useless corrupted records are written in the journal everytime a transaction ends without jackrabbit update! This causes polution of the journal, as other cluster nodes try to sync with the corrupted updates and fail doing so as ClusterRecordDeserializer can't deserialize it (the record identifier is empty). > ChangeLogRecord (and even other ClusterRecord implementations too) should only write if there's effective updates. > I propose the following solution: > *) add the following method in Changelog so clients can know if there's effective updates: > public boolean hasUpdates() { > return !(addedStates.isEmpty() && modifiedStates.isEmpty() && deletedStates.isEmpty() && modifiedRefs.isEmpty()); > } > *) change ClusterRecord with: > public final void write() throws JournalException { > > if (hasUpdates()) { > record.writeString(workspace); > doWrite(); > record.writeChar(END_MARKER); > } > } > > protected abstract boolean hasUpdates(); > *) implement hasUpdates for every ClusterRecord implementation: > ----> ChangeLogRecord: > protected boolean hasUpdates() { > return changes.hasUpdates() || !events.isEmpty(); > } > ----> LockRecord and NamespaceRecord: > protected boolean hasUpdates() { > return true; > } > ----> NodeTypeRecord: > protected boolean hasUpdates() { > return !collection.isEmpty(); > } > Best regards, > Stephane Landelle -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.