You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Stefan Egli (JIRA)" <ji...@apache.org> on 2014/07/22 17:16:39 UTC

[jira] [Comment Edited] (SLING-3785) Try to work around repository problems during voting

    [ https://issues.apache.org/jira/browse/SLING-3785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14070369#comment-14070369 ] 

Stefan Egli edited comment on SLING-3785 at 7/22/14 3:15 PM:
-------------------------------------------------------------

-use JackrabbitNode.rename() instead of Session.move()-


was (Author: egli):
use JackrabbitNode.rename() instead of Session.move()

> Try to work around repository problems during voting
> ----------------------------------------------------
>
>                 Key: SLING-3785
>                 URL: https://issues.apache.org/jira/browse/SLING-3785
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>            Reporter: Stefan Egli
>            Assignee: Stefan Egli
>            Priority: Critical
>             Fix For: Discovery Impl 1.0.10
>
>
> We've seen race-conditions, where the repository refuses to delete a node, with the following exception:
> {code}
> 16.07.2014 14:58:59.134 *ERROR* [pool-5-thread-5] org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler checkView: encountered a persistence exception during view check: org.apache.sling.api.resource.PersistenceException: Unable to delete resource at /var/discovery/impl/previousView/4df5cd91-c99c-45d3-9b27-728c6e84f0f4 org.apache.sling.api.resource.PersistenceException: Unable to delete resource at /var/discovery/impl/previousView/4df5cd91-c99c-45d3-9b27-728c6e84f0f4
>     at org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.delete(JcrResourceProvider.java:491)
>     at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.delete(ResourceResolverImpl.java:1044)
>     at org.apache.sling.discovery.impl.cluster.voting.VotingHandler.promote(VotingHandler.java:314)
>     at org.apache.sling.discovery.impl.cluster.voting.VotingHandler.analyzeVotings(VotingHandler.java:141)
>     at org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler.doCheckView(HeartbeatHandler.java:299)
>     at org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler.checkView(HeartbeatHandler.java:277)
>     at org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler.run(HeartbeatHandler.java:153)
>     at org.apache.sling.commons.scheduler.impl.QuartzJobExecutor.execute(QuartzJobExecutor.java:105)
>     at org.quartz.core.JobRunShell.run(JobRunShell.java:207)
>     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>     at java.lang.Thread.run(Unknown Source)
> Caused by: javax.jcr.ItemNotFoundException: 4f06dc87-401d-44b6-b6da-2e0bff2e2bb6
>     at org.apache.jackrabbit.core.ItemManager.getItemData(ItemManager.java:384)
>     at org.apache.jackrabbit.core.ItemManager.getNode(ItemManager.java:669)
>     at org.apache.jackrabbit.core.NodeImpl.onRemove(NodeImpl.java:696)
>     at org.apache.jackrabbit.core.NodeImpl.removeChildNode(NodeImpl.java:624)
>     at org.apache.jackrabbit.core.ItemRemoveOperation.perform(ItemRemoveOperation.java:78)
>     at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
>     at org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:91)
>     at org.apache.jackrabbit.core.ItemImpl.remove(ItemImpl.java:322)
>     at org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.delete(JcrResourceProvider.java:486)
>     ... 11 more
> {code}
> While this needs to be treated at the repository level, the discovery.impl can help work around this issue by following a tested workaround:
>  * when delete fails, try to rename the 'previousview' node to 'previousview_trash_${UUID}' 



--
This message was sent by Atlassian JIRA
(v6.2#6252)