Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-3069

add optional consistency checks to test suite

    XMLWordPrintableJSON

Details

    • Wish
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • None
    • None
    • jackrabbit-core
    • None

    Description

      We know that certain sequences of calls can cause the persistent state to become inconsistent, such as by producing orphaned nodes.

      This usually does not manifest itself in tests failing. However, it can mean (silent) data loss, and become visible at a different point of time in the form of nodes that can be discovered using a query, but which can not compute their path.

      Checking the persistence layer's consistency is implementation specific. In Jackrabbit, there is a consistency check call on the PersistenceManager that we could use. It just logs a results and doesn't provide a checkable return value, but it would be a start.

      Proposed helper code (thx to Marcel for the proposal):

      /**

      • Runs a consistency check on the given workspace.
        *
      • @param name the name of the workspace to perform the consistency check.
      • @param repo the repository instance.
      • @throws RepositoryException if an error occurs while getting the
      • workspace with the given name.
        */
        public static void checkConsistency(String name, RepositoryImpl repo)
        throws RepositoryException { RepositoryImpl.WorkspaceInfo wspInfo = repo.getWorkspaceInfo(name); wspInfo.getPersistenceManager().checkConsistency(null, true, false); }

      Attachments

        1. JCR-3069.patch
          28 kB
          Julian Reschke
        2. JCR-3069-extra-test.patch
          8 kB
          Alex Deparvu
        3. JCR-3069.patch
          16 kB
          Julian Reschke
        4. JCR-3069.patch
          17 kB
          Julian Reschke
        5. JCR-3069.patch
          13 kB
          Julian Reschke

        Issue Links

          Activity

            People

              reschke Julian Reschke
              reschke Julian Reschke
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: