jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephan Huttenhuis (JIRA)" <j...@apache.org>
Subject [jira] Created: (JCR-2590) Rollback of database transaction in BundleDbPersistenceManager leads to invalid bundle states
Date Fri, 02 Apr 2010 12:26:27 GMT
Rollback of database transaction in BundleDbPersistenceManager leads to invalid bundle states
---------------------------------------------------------------------------------------------

                 Key: JCR-2590
                 URL: https://issues.apache.org/jira/browse/JCR-2590
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-core
            Reporter: Stephan Huttenhuis
             Fix For: 1.6.1
         Attachments: DbNameIndex.patch, DbNameIndex_force_exception.patch, DbNameIndexTest.java

The bundle state of nodes in the database can become invalid if a database transaction is
rolled back. BundleDbPersistenceManager shares the ConnectionRecoveryManager and connection
with their DbNameIndex instance. This instance keeps a bidirectional map of labels to a unique
id and stores these pairs in the database.

The problem occurs in this scenario:
- A session adds a property to a node, with a property name that  hasn't been used before.
- The session is saved and BundleDbPersistenceManager starts a new transaction on the database
connection.
- Then the state of the node is serialized. 
- For each property, the corresponding unique index is determined using DbNameIndex.stringToIndex.

- The newly added property name doesn't exist yet and is added to the database and memory
mappings, using the connection and transaction of the persistence manager.
- Some database error occurs, the BundleDbPersistenceManager performs a rollback on the connection
and tries again.
- The new id for the new property name is still present in memory, but has _not_ been stored
in the database, because of the rollback

If this id is used for serializing nodestates, deserialing this state will fail after a restart.
BundleDbPersistenceManager.loadBundle shows the message: failed to read bundle: 7bad7f23-d9aa-4e7e-8da3-1c3d0eb2aee5:
java.lang.IllegalArgumentException: Index not found: 5

This issue can be reproduced by applying DbNameIndex_force_exception.patch in order to force
a rollback and to use the DbNameIndexTest.java unit test. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message