You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Alexander Klimetschek (JIRA)" <ji...@apache.org> on 2008/02/27 18:59:51 UTC

[jira] Commented: (JCR-1428) Add API for selective bundle consistency check (Jackrabbit-specific)

    [ https://issues.apache.org/jira/browse/JCR-1428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12573006#action_12573006 ] 

Alexander Klimetschek commented on JCR-1428:
--------------------------------------------

After a chat with Jukka, we came up with this solution:

- only work with UUIDs, because this is what the PM uses as identifiers and what is displayed in the error log if something is inconsistent

- extend the PersistenceManger interface by a new method: PersistenceManager.checkConsistency(String[] uuids, bool recurse
- implement it only in BundleDbPersistenceManager, as it is now done by checkConsistency(), but handle the new parameters
- keep the existing configuration based consistencyCheck upon startup (needs migration for the new method)

- RepositoryImpl.checkConsistency(String workspace, String[] uuids) which calls PersistenceManager.checkConsistency(uuids, false)
- RepositoryImpl.checkConsistency(String workspace) will check the entire workspace, calls PersistenceManager.checkConsistency(root_uuid, true)
- to clean up the versioning "workspace", pass "jcr:system" as workspace name

- WorkspaceImpl.checkConsistency(String[] uuids) calls RepositoryImpl.checkConsistency(getName(), uuids)
- WorkspaceImpl.checkConsistency() calls RepositoryImpl.checkConsistency(getName())

- only logging during the check, no special return values

Open Problem: 

- Doing the consistency check on an active workspace might cause problems with cache coherence and other such stuff. Doing the consistency check only at startup avoids all those issues, but is much less convenient than an API for doing that.

We could simply defer this to the client calling the consistency check to do so only when there is no activity, but it probably has no full control or awareness of that. Another idea would be to "stop" activity, ie. invalidate any transient sessions and clearing all caches.

WDYT?

> Add API for selective bundle consistency check (Jackrabbit-specific)
> --------------------------------------------------------------------
>
>                 Key: JCR-1428
>                 URL: https://issues.apache.org/jira/browse/JCR-1428
>             Project: Jackrabbit
>          Issue Type: New Feature
>          Components: jackrabbit-core
>            Reporter: Alexander Klimetschek
>             Fix For: 1.3.4
>
>
> Add a jackrabbit-specific API for doing a selective consistencyCheck, ie. on single nodes. The current entire-workspace check can be very slow if there workspace is large enough. Also it should be easy to write a tool to invoke that feature programmatically rather than by configuration + restart (see below).
> Existing Implementation:
> The current bundle consistencyCheck feature is enabled by setting a bundle PM parameter and restarting Jackrabbit, it will then run upon startup (see JCR-972 for the only issue regarding bundle consistency check). This check looks for broken parent-child relationships, ie. it will remove any child node entries that reference non-existing parent nodes. For non-existing parent UUIDs and other problems in bundles it will log those.
> Outlook:
> An advanced consistencyCheck could also check for non-existing version nodes and vice-versa (see JCR-630), but this is not the focus of this issue and could be a later addition to the API.

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