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

Jukka Zitting commented on JCR-1753:
------------------------------------

I'm not sure that there will be that many syncs, especially if we don't trigger 
the sync from Repository.login() calls. Additionally, if the node already is in 
sync with the cluster (which would be the usual case), then the sync amounts to 
just retrieving the journal revision number and comparing it with the local 
state.

If the retrieval of the journal revision number is expensive, we could add an 
additional local guard that just ensures that at least one cluster sync has 
been done between a client calling Session.refresh() (or Repository.login()) 
and the call returning. Whether it's that thread or some other thread doing the 
sync doesn't matter. Something like this:

    private volatile int syncCount = 0;

    int count = syncCount;
    mutex.acquire();
    try {
        if (count == syncCount) {
            doSync();
            syncCount++;
        }
    } finally {
        mutex.release();
    }


> Allow means force a Repository to synchronize with the cluster
> --------------------------------------------------------------
>
>                 Key: JCR-1753
>                 URL: https://issues.apache.org/jira/browse/JCR-1753
>             Project: Jackrabbit
>          Issue Type: New Feature
>          Components: clustering, jackrabbit-api, jackrabbit-core
>            Reporter: Micah Whitacre
>            Assignee: Jukka Zitting
>         Attachments: JCR-1753.tar.gz
>
>
> Based on the thread on the user mailing list I'm logging this to propose 
> adding a sync() method to force cluster synchronization using the 
> JackrabbitRepository extension API.
> The purpose of the method is such that in a distributed clustered environment 
> sometime cluster synchronization does or has not occurred such that certain 
> repositories are in a stale state.  This method would provide a means to 
> force a repository to update pull in possible changes made by other 
> Jackrabbit repositories.

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

Reply via email to