jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Mueller (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-2786) Cluster sync not always done when calling session.refresh(..)
Date Fri, 15 Oct 2010 14:21:36 GMT

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

Thomas Mueller commented on JCR-2786:
-------------------------------------

The easiest solution is to call syncCount++ before calling journal.sync(), but I will also
replace the volatile syncCount with AtomicInteger.

> Cluster sync not always done when calling session.refresh(..)
> -------------------------------------------------------------
>
>                 Key: JCR-2786
>                 URL: https://issues.apache.org/jira/browse/JCR-2786
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: clustering
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>
> Session.refresh(..) is supposed to synchronize cluster changes, but this doesn't always
happen, specially if the syncDelay is low. The reason is a wrong assumption in ClusterNode.sync:
The code there to avoid duplicate sync calls doesn't always work as expected. The following
algorithm is used:
>         int count = syncCount;
>         syncLock.acquire();
>         if (count == syncCount) {
>             journalSync();
>             syncCount++;
>         }
>         syncLock.release();
> The problem is that the background thread might be at the line "syncCount++" when Session.refresh(..)
is called, so that the main thread believes journalSync was already called and thus doesn't
call it.

-- 
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